我正在尝试使用squeelize orm将SQL Server与node.js一起使用。但我一直收到“未找到主机”错误:
HostNotFounderRror[SequelizeHostNotFounderRror]:无法连接到LocalHost//SQLExPress:1433-getaddrinfo ENOTFOUND LocalHost//SQLExPress
无法连接到localhost//sqlexpress:1433-getaddrinfo ENOTFOUND localhost//sqlexpress',代码:“eSocket
代码:
var db = new Sequelize('test', 'root', 'secret', {
host: 'localhost\\SQLEXPRESS',
dialect: 'mssql',
pool: {
max: 5,
min: 0,
idle: 10000
},
});
db.authenticate()
.then(()=>console.log('Database connected'))
.catch(err=> console.log(err))
请帮帮我!
正在尝试options.port关系数据库的端口。
var db = new Sequelize('test', 'root', 'secret', {
host: 'localhost\\SQLEXPRESS',
dialect: 'mssql',
pool: {
max: 5,
min: 0,
idle: 10000
},
port:56198,
});