You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For sequelize users to connect from nodejs to mssql with hostname containing instanceName.
Backslash wont work for hostnames due to some rules of sequelize(tedious)
Try giving instanceName as shown
Worked for me
Ex: Host="192.168.4.64\SERVER1"
constSequelize=require('sequelize');constsequelize=newSequelize('Audit','aaaa','bbbb',{host: "192.168.4.64",dialect: 'mssql',dialectOptions: {options: {instanceName: 'SERVER1'}}});sequelize.authenticate().then(()=>{console.log('Connection has been established successfully.');}).catch(err=>{console.error('Unable to connect to the database:',err);});
What are you doing?
I am trying to use a host with a backslash
*HOST_NAME and PATH fillers for actual host
What do you expect to happen?
I expect to get 1 backslash in host used in Sequelize to properly connect
What is actually happening?
, instead I get connection error due to 2 being used. If I use only 1 backslash in config, I get 0 backslashes in host and another connection error
Dialect: mssql
Sequelize version: 4.38.1
Tested with latest release: No
The text was updated successfully, but these errors were encountered: