I want to connect with Microsoft Sql using sequelize. I found this link http://docs.sequelizejs.com/manual/installation/getting-started.html
and i wrote the code below with nodejs:
require('dotenv').config();
var express = require('express');
var app = express();
const Sequelize = require('sequelize');
const sequelize = new Sequelize(process.env.DB_NAME,null,null, {
dialect: 'mssql',
host: process.env.DB_HOST + "\\" + process.env.DB_SERVER,
operatorsAliases: false,
pool: {
max: 5,
min: 0,
acquire: 30000,
idle: 10000
}
});
sequelize.authenticate().then((err) => {
console.log('Connection successful', err);
})
.catch((err) => {
console.log('Unable to connect to database', err);
});
app.listen(process.env.PORT);
console.log('Starting Server on Port ', process.env.PORT);
But when I run the code i have an error:
sequelize deprecated String based operators are now deprecated. Please use
Symbol based operators for better security, read more at
http://docs.sequelizejs.com/manual/tutorial/querying.html#operators
node_modules\sequelize\lib\sequelize.js:242:13
Unable to connect to database { SequelizeHostNotFoundError: Failed to
connect to USER-PC\SQLEXPRESS:1433-getaddrinfo ENOTFOUND USER-PC\SQLEXPRESS
at Connection.connection.on.err (C:\Users\User\Desktop\loginApp\node_modules
\sequelize\lib\dialects\mssql\connection-manager.js:98:22)
what i did wrong and i cant connect to database ?