Connecting to serverName\instanceName
var config = {
user: '...',
password: '...',
server: 'serverName\instanceName',
database: '...'
}
throws and err
ConnectionError: connection to serverName\instanceName:1433 - failed Error:
getaddrinfo ENOTFOUND
Use this.
var config = {
user: '...',
password: '...',
server: 'serverName',
database: '...',
options: {
instanceName: 'instanceName'
}
}
Still throws:
Error: Failed to lookup instance on serverName : Error: getaddrinfo ENOTFOUND
Change serverName to your server's ip or hostname.
Also make sure SQL Server Browser service is running on the database server, and UDP port 1444 on the database server is reachable.
Changing serverName to ip did the trick. Also it looks like adding domain to serverName works as well.
Thanks Patrik.
I have getting same error too, but I didn't fix. How can I fix this?
var config = {
user: 'sa',
password: 'a',
server: '127.0.0.1',
database: 'ChatServer',
port :'1433'
,
options: {
instanceName: 'R2'
}
}
Hope that will help someone
I was getting following error: Port for SQLEXPRESS not found in ServerName
It appeared that TCP/IP was disabled for sqlexpress - http://www.linglom.com/it-support/enable-remote-connection-on-sql-server-2008-express/
I resolved issue by updating db configuration in sequelize as like this
{
"username": "sa",
"password": "sa@123",
"database": "test",
"host": "localhost",
"dialect": "mssql",
"port": 1433,
"dialectOptions": {
"instanceName": "SQLEXPRESS"
},
}
Most helpful comment
Use this.