似乎无法连接到AWS托管的我的数据库。我将出站和入站规则设置为0.0.0.0和公共可访问性。
我能够通过Microsoft SQL Server Management Studio进行连接。但是,当我尝试通过Node.js上的Sequelize连接时,出现以下错误
Unable to connect to the database: { SequelizeAccessDeniedError: Login failed for user 'admin'.
我使用的凭据与通过SQL Management Studio连接时的凭据相同。
Node.js代码:
const Sequelize = require("sequelize");
const sequelize = new Sequelize("database", "admin <same username when I connect through SQL Management Studio> ", "<inserted correct passowrd, not an issue>", {
host: "<inserted correct host, not an issue>",
dialect: "mssql",
operatorsAliases: false,
pool: {
max: 5,
min: 0,
idle: 10000
}
});
sequelize
.authenticate()
.then(() => {
console.log("Connection has been established successfully.");
})
.catch(err => {
console.error("Unable to connect to the database:", err);
});
module.exports.sequelize = sequelize;
module.exports.Sequelize = Sequelize;