I'm trying to use the pyodbc library on my MacBook Pro running Mac OS X Mojave.
However, I can't install the driver properly. I've followed the pyodbc guide here but I can't reproduce the results on the page.
I am able to run the command :
tsql -S mydb -U myuser -P mypassword
I successfully get results from my database. However, when I proceed with the configurations on odbcinst.ini and odbc.ini and then try to run the command:
isql mydb myuser mypassword -v
The error message I get is:
[IM002][unixODBC][Driver Manager]Data source name not found and no default driver specified
[ISQL]ERROR: Could not SQLConnect
Here are the contents of my odbcinst.ini file:
[FreeTDS]
Description=FreeTDS Driver for Linux & MSSQL
Driver=/usr/local/Cellar/freetds/1.00.109/lib/libtdsodbc.0.so
FileUsage=1
[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/usr/local/Cellar/msodbcsql17/17.2.0.1/lib/libmsodbcsql.17.dylib
UsageCount=1
Here are the contents of my odbc.ini file:
[mydb]
Description = FreeTDS
Driver = F
Servername = myServer
Server = servername
Port = 1433
UserName = SA
Password = pwd
Trace = Yes
Database = dbname
I'm not sure what I'm doing right. I've ensured that all the drivers are in the directories listed in the odbcinst.ini file.
Thanks in advance for your help. :)
Edit - 1 I forgot to mention earlier that when I was installing freetds with brew, I could not use the command specified in the instructions.
The instruction provides the command:
brew install freetds --with-unixodbc
However, when I used that command, I get the following error:
Error: invalid option: --with-unixodbc
So, I installed freetds without the --with-unixodbc extension.
Could this be a reason why?