I wanted to remotely connect to a sql-server database on my network in python. So I the installed pyodbc following the steps given on this page. It instructs to first "Install the Microsoft ODBC Drivers for SQL-Server" by following these instructions.
Having completed these steps (and only these steps) I identified the driver path and tried running this code in python.
import pyodbc as podbc
conn = podbc.connect("Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.8.so.1.1;"
"Server=192.XXX.XXX.XXX;"
"Database=db_name;"
"uid=xxxx;"
"pwd=xxxx;")
On execution I am getting the error:
pyodbc.OperationalError: ('08001', '[08001] [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2746 (10054) (SQLDriverConnect)')
It would be helpful if you could tell me why am I getting this error and if I'm missing any steps in the installation process. Also, I am able to access the sql-server remotely through a windows machine, but whenever I'm trying to do it via an ubuntu machine I'm getting this error.