首页 > 其他分享 >original: Error: Unknown storage engine 'InnoDB'

original: Error: Unknown storage engine 'InnoDB'

时间:2022-11-21 00:11:47浏览次数:70  
标签:engine Unknown storage InnoDB Error sequelize

问题

Nodejs 工程下,用 sequelize 向一个现有的 MySQL 数据库中初始化数据时报错,如题:

original: Error: Unknown storage engine 'InnoDB'

ENV

  • MySQL 5.6
  • Sequelize: ^6.25.5

排查

  • 查看 mysql 配置 my.ini 中的默认引擎
# The default storage engine that will be used when create new tables when
default-storage-engine=MYISAM

The default engine for a model is InnoDB.

修改默认 engine

const sequelize = new Sequelize(db, user, pw, {
  define: { engine: 'MYISAM' }
});
  • 再次执行,回显
(node:1940) [SEQUELIZE0006] DeprecationWarning: This database engine version is not supported, please update your database server. More information https://github.com/sequelize/sequelize/blob/main/ENGINE.md
(Use `node --trace-deprecation ...` to show where the warning was created)

数据库不便升级,考虑 sequelize 是否可降级。实在不行,我只能重装升级 msqyl 了。

标签:engine,Unknown,storage,InnoDB,Error,sequelize
From: https://www.cnblogs.com/duxing/p/16910099.html

相关文章