简体   繁体   中英

Node.js Sequelize connection

const Sequelize = require('sequelize');
const sequelize = new Sequelize('abc', 'abc', 'abc', {
  host: 'localhost',
  dialect: 'mssql'
});

I am trying to connect the SQLServer from using above code, but getting below error on sequelize.authenticate()

Unable to connect to the database: { SequelizeConnectionError: Invalid arguments: "instanceName" must be a string

Note: I am using the latest version of sequelize

Example of my connection

const Sequelize = require('sequelize');

const sequelize = new Sequelize('database', 'username', 'password', {
    operatorsAliases: Sequelize.Op.Aliases,
    freezeTableName: true,
    logging: console.log,
    dialect: 'mssql',
    host: 'host'
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM