Goal: Connect to MSSQL using FreeTDS / ODBC in Python.
Host: Ubuntu 11.10 x86_64
Install:
sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy
In /etc/odbcinst.ini:
[FreeTDS]
Description=FreeTDS Driver
Driver=/usr/lib/odbc/libtdsodbc.so
Setup=/usr/lib/odbc/libtdsS.so
Since your error message is coming from unixODBC, the upstream docs are meaningful:
... as are various articles:
The upstream docs and most articles I'm finding are preferring connection details in the .ini over the connection string. Regardless, the keyword/value pairs are meaningful, and you might prefer to put the detail in the .ini over the connection string.
Just in case: be sure to replace parameters marked
<PARAMETER>
with their actual values from the original example. For example, useDATABASE=mydatabase
(replacing "mydatabase" with the actual name) and notDATABASE=<DATABASE_NAME>
.Also, hello everyone from the past 8 years! Looks like GitHub recently added notifications for gists.