node-mssql icon indicating copy to clipboard operation
node-mssql copied to clipboard

Dont connect with selected port

Open estvmachine opened this issue 11 years ago • 5 comments

My connection try always start in the default port 1433 instead of the choosen port. This is my config object:

{
"server": "random.imcloud.cl",
"port":"8003" ,
"database":"DATABASE_NAME",
 "user":"USERNAME",
"password":"*************",
 "options":{"tdsVersion":"7_1",
                  "encrypt":true}
}

My response with this say: "ConnectionError: Failed to connect to random.imcloud.cl:1433 IN 15000ms"

estvmachine avatar Jun 23 '15 14:06 estvmachine

In my case i can specify port, unless i'm trying to connect to a specific instance. For example :

{ "server": "localhost\SQLEXPRESS", "port" : "1433", "user": "USERNAME", "password": "*************", "database": "DATABASE_NAME" }

Also tried this one (as specified in Tedious configuration options https://www.npmjs.com/package/mssql#tedious):

{ "server": "localhost", "port" : "1433", "user": "USERNAME", "password": ""*************",", "database": "DATABASE",

"options": { "instanceName": "SQLEXPRESS" } }

Both results saying : "Failed to connect to localhost:undefined in 15000ms" So I think both issues may be related.

Zam4 avatar Jul 08 '15 07:07 Zam4

Are you sure that TCP connections are enabled in SQL, and that windows firewall isn't blocking the connections? can you telnet/netcat to the system in question on the port in question?

tracker1 avatar Jul 12 '15 03:07 tracker1

Maybe that its the problem, thank you

estvmachine avatar Jul 14 '15 17:07 estvmachine

in my case I cannot specify a port when using

options: { encrypt: true }

lehneres avatar Jul 27 '15 15:07 lehneres

Closing due to inactivity.

patriksimek avatar Feb 04 '16 01:02 patriksimek