I want to connect to Microsoft SQL Server with Sequelize in node js. When I tried to connect, I get this error in the console:
Error:SequelizeConnectionError: Failed to connect to localhost:1433 - Could not connect (sequence)
Could you please help to fix this error, because I have looked in many websites and the error continues to show up.
This is my code:
import { Sequelize } from "sequelize";
import dotenv from 'dotenv';
dotenv.config({path:'.env'})
const db = new Sequelize(process.env.BD_NOMBRE,process.env.BD_USUARIO,process.env.BD_PASSWORD,{
host: process.env.BD_HOST,
port: process.env.BD_PORT,
dialect: 'mssql',
define:{
timestamps: 0
},
pool:{
max:5,
min:0,
acquire:30000,
idle:10000
},
operatorsAliases:0
});
export default db;
1条答案
按热度按时间hyrbngr71#