【发布时间】:2018-11-10 15:11:34
【问题描述】:
我正在尝试连接到我新创建的 ms sql 数据库。但是,当我尝试连接时出现错误。错误:无法连接到数据库:{ SequelizeConnectionError: Failed to connect to ....
const sequelize =new Sequelize({
dialect: 'mssql',
dialectModulePath: 'tedious',
dialectOptions: {
driver: '**SQL Server Native Client 11.0 - is this correct?**',
instanceName: '**where do i get this?**'
},
host: '**what do i put for this?'is this the end point?**',
port: '1433',
username: 'username',
password: 'password,
database: '**what do i put for this?**',
pool: {
min: 0,
max: 10,
idle: 10000
}
});
【问题讨论】:
-
我对sequelize不太了解,但是你可以找到instanceName做一个
SELECT @@servername,host是endpoint,database是你要连接的数据库的名字(一个 SQL Server 实例为 X 数量的数据库提供服务,每个数据库都有自己的文件)。如果您使用 SSMS,则数据库是下面列出的(猜猜看)“数据库”。
标签: sql-server node.js amazon-web-services sequelize.js amazon-rds