Hello everyone,
I am trying to connect to a remote database in a SQL Server Engine for the first time, but I am struggling with it in Python 3.
As a start, I have installed 'Microsoft ODBC Driver 17 for SQL Server' in a Debian OS and everything seems to be setup without problem, at least there was no issues following all the steps of that tutorial.
Then I installed the pyodbc module, and tried to connect to the remote database, but I am always reciving this error:
From this machine where I am, in /etc/odbcinst.ini I have:
Anyone knows how to solve this?
I am trying to connect to a remote database in a SQL Server Engine for the first time, but I am struggling with it in Python 3.
As a start, I have installed 'Microsoft ODBC Driver 17 for SQL Server' in a Debian OS and everything seems to be setup without problem, at least there was no issues following all the steps of that tutorial.
Then I installed the pyodbc module, and tried to connect to the remote database, but I am always reciving this error:
Error:pyodbc.OperationalError: ('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')
This is the statement used:SQLdbconnection = pyodbc.connect(r'DRIVER={ODBC Driver 17 for SQL Server};SERVER="host\service";DATABASE=database;UID="user";PWD="password"')I have another Python 2 script running from another place made from another person that uses FreeTDS driver instead, and its working fine, for the same DB and credentials.
From this machine where I am, in /etc/odbcinst.ini I have:
Output:[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.4.so.2.1
UsageCount=1
[ODBC]
Trace = Yes
TraceFile = /dev/stdout
Note: I add those last 3 lines to get a verbose mode, while it tries to connect.Anyone knows how to solve this?