Problem with node.js and sql server

YuChan

Registered
Jun 2, 2021
1
0
1
france
cPanel Access Level
Website Owner
Hello,

I have one Cpanel L and i have one problem.

I have create a bot discord.js and i need to connect at my SQL server (mmsql) who is on one VPS (vps at contabo)

But if i start node index.js i have this error :

Code:
originalError: ConnectionError: Failed to connect to 161.97.148.108:1433 - Could not connect (sequence)
      at ConnectionError (/home/cp1651852p08/nodevenv/bot-discord/crazy-ddtank.com/14/lib/node_modules/tedious/lib/errors.js:13:12)
      at Connection.socketError (/home/cp1651852p08/nodevenv/bot-discord/crazy-ddtank.com/14/lib/node_modules/tedious/lib/connection.js:1641:56)
      at /home/cp1651852p08/nodevenv/bot-discord/crazy-ddtank.com/14/lib/node_modules/tedious/lib/connection.js:1400:21
      at SequentialConnectionStrategy.connect (/home/cp1651852p08/nodevenv/bot-discord/crazy-ddtank.com/14/lib/node_modules/tedious/lib/connector.js:129:14)
      at Socket.onError (/home/cp1651852p08/nodevenv/bot-discord/crazy-ddtank.com/14/lib/node_modules/tedious/lib/connector.js:149:12)
      at Socket.emit (events.js:315:20)
      at emitErrorNT (internal/streams/destroy.js:106:8)
      at emitErrorCloseNT (internal/streams/destroy.js:74:3)
      at processTicksAndRejections (internal/process/task_queues.js:80:21) {
    code: 'ESOCKET'
How to connect at my sql server please.

PS : it working on my local computer a remote access.

Please help me
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
6,951
920
313
cPanel Access Level
Root Administrator
Hey there! The first thing I would test would be a manual connection to the database on the command line. I would start with something simple like telnet, just to confirm the port is open and your two machines can communicate:

Code:
telnet 161.97.148.108 1433
If that doesn't work, you can start looking at the firewall settings on both systems to see if there is a connection issue.

If that does work, I'd recommend testing the MySQL user login directly from a script or command line to see if you can access the user and database properly.