I'm trying to connect to a remote database with knex but I get this error:
"tedious deprecated The default value for options.encrypt
will change from false
to true
. Please pass false
explicitly if you want to retain current behaviour. at node_modules\mssql\lib\tedious.js:212:23
Unhandled rejection ConnectionError: Failed to connect to 151.80.119.227,14831:1433 - getaddrinfo ENOTFOUND 151.80.119.227,14831"
I can connect via Microsoft sql server management studio with same host, user, password so I'm lost.
Edit: This is how I create my knex var:
var knex = require('knex')({
client: 'mssql',
connection: {
server : '151.80.119.227,14831',
user : '****',
password : '****',
database : '****'
}
});
I can connect to it via python with:
con = pyodbc.connect("DRIVER={SQL Server};server=151.80.119.227,14831;database=*****;uid=****;pwd=****")
So why won't it connect through node.js ....
Port should actually be specified in the MSSQL options variable:
var knex = require('knex')({
client: 'mssql',
connection: {
server : '151.80.119.227',
user : '****',
password : '****',
database : '****',
options: {
port: 14831
}
}
});
This is from reading the code at https://github.com/tgriesser/knex/blob/v0.16.2/src/dialects/mssql/index.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With