I've my nodejs app connected to MSSQL server, worked perfectly in my Windows laptop, sing mssql@npm
The same app is not able to see the database in my Ubuntu laptop.
I defined the mssql connectivity in Ubuntu as below, am I missing any thing?
- Updated my ~/.profile, as:
~$ export ODBCINI=/etc/odbc.ini ~$ export ODBCSYSINI=/etc ~$ export FREETDSCONF=/etc/freetds/freetds.conf
Logged-out the laptop, to get the above active, and the profile refreshed.
Installed the required connectivity packages.
~$ sudo apt-get install unixodbc unixodbc-dev freetds-dev sqsh tdsodbc -y
- Configured FreeTDS
~$ sudo gedit /etc/freetds/freetds.conf [ACUMENSERVER] host = 192.168.0.10 port = 1433 tds version = 7.0
- Tested the FreeTDS connection with sqsh, and it works fine:
~$ sqsh -S ACUMENSERVER -U mssql-username -P mssql-password
- Configured ODBC - odbcinst.ini:
~$ sudo gedit /etc/odbcinst.ini [FreeTDS] Description = TDS driver (Sybase/MS SQL) Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so CPTimeout = CPReuse = FileUsage = 1
- Configured ODBC - odbc.ini:
~$ sudo gedit /etc/odbc.ini [ACUMENSERVER] Driver = FreeTDS Description = ODBC connection via FreeTDS Trace = No Servername = ACUMENSERVER Database = myDataBase
- Tested the ODBC connection with isql, and it works fine:
isql -v ACUMENSERVER mssql-username mssql-passward
When I run my nodejs app (that is working fine in Windows), I got th below error in Ubuntu, considering all the above got done, and checked:
{ name: 'ConnectionError',
message: 'Failed to connect to ACUMENSERVER:1433 - getaddrinfo ENOTFOUND',
code: 'ESOCKET' }
What could be the wrong/missing thing here, I'm opened to use another npm package for mssql connectivity.