我正在尝试连接到我新创建的ms sql数据库。但是,当我尝试连接时,我收到错误。错误:无法连接到数据库:{SequelizeConnectionError:无法连接到....
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
}
});
答案 0 :(得分:0)
dbname是您正在与之交互的数据库的名称(您将其输入到aws中)
还要确保您npm install tedious -S
const sequelize =new Sequelize('dbname', 'dbusername', 'dbpassword', {
host: 'http://endpoint-from-aws.com'
dialect: 'mssql',
operatorsAliases: false,
pool: {
min: 0,
max: 10,
idle: 10000
}
});
http://docs.sequelizejs.com/manual/installation/getting-started.html