I\'m trying to connect to an MSSQL database from python on Linux (SLES).
I have installed pyodbc and Free TDS. From the command line:
tsql -H server
This worked for me, not sure but thought that it might help someone
run below command to find which version of odbcinst and isql you are using
which odbcinst
which isql
Then run $ odbcinst -j to find which odbc.ini and odbcinst.ini is getting used.
In odbcinst.ini add
[FreeTDS]
Description=FreeTDS Driver for Linux & MSSQL
Driver=/usr/local/lib/libtdsodbc.so
Setup=/usr/local/lib/libtdsodbc.so
UsageCount=1
And in odbc.ini configure your server as
[YOUR_SERVER]
Driver = FreeTDS
Servername =
Database =
I found some good description at https://docs.snowflake.net/manuals/user-guide/odbc-linux.html#unixodbc
Also take a look at https://github.com/lionheart/django-pyodbc/wiki/Mac-setup-to-connect-to-a-MS-SQL-Server