sudo apt-get install unixodbc unixodbc-dev freetds-dev tdsodbc freetds-binEdit the file /etc/freetds/freetds.conf
nano /etc/freetds/freetds.confAdd your connection information to the end.
[<connection_name>]
host = <hostname>
port = <port>
tds version = 7.0Test the new connection with
tsql -S <connection_name> -U <username> -P <password>Run odbcinst -j to find the file directories for odbcinst.ini and odbc.ini
Update odbcinst.ini to include the info below.
odbcinst -j
# get path from results of odbcinst -j
nano /etc/odbcinst.ini
[FreeTDS]
Description=FreeTDS Driver for Linux & MSSQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
CPTimeout =
CPREuse =
FileUsage = 1
# control x to saveNext, edit the odbc.ini file.
Add the following info.
odbcinst -j
# get path from results of odbcinst -j
nano /usr/local/etc/odbc.ini
[<connection_name>]
Description = <connection_description>
Driver = FreeTDS
Servername = <connection_name>
# note: FreeTDS must match the name given in odbcinst.iniFinally, pyodbc for python can be installed
pip install pyodbc