const Sequelize = require('sequelize');
const sequelize = new Sequelize('abc', 'abc', 'abc', {
host: 'localhost',
dialect: 'mssql'
});
我正在尝试使用上面的代码连接SQLServer,但出现以下错误 在sequelize.authenticate()上
Unable to connect to the database: { SequelizeConnectionError: Invalid arguments: "instanceName" must be a string
注意:我正在使用最新版本的sequelize
答案 0 :(得分:0)
我的联系示例
const Sequelize = require('sequelize');
const sequelize = new Sequelize('database', 'username', 'password', {
operatorsAliases: Sequelize.Op.Aliases,
freezeTableName: true,
logging: console.log,
dialect: 'mssql',
host: 'host'
});