Pypyodbc: Can't open lib 'FreeTDS' : file not found\") error when trying to connect to SQL server

廉价感情. 提交于 2019-12-03 09:55:28

Check your /etc/odbcinst.ini or it could be under /etc/unixODBC/odbcinst.ini

In your connection string you have something like this "DRIVER=FreeTDS" there needs to be an entry in that file like the following. You may need to change your driver location.

[FreeTDS]
Description             = FreeTDS unixODBC Driver
Driver          = /usr/lib64/libtdsodbc.so.0
Setup           = /usr/lib64/libtdsodbc.so.0
UsageCount              = 1
Javier

First, you can use pymssql which doesn't require configuring unixODBC, which is the problem here.

To configure unixODBC with FreeTDS, do the following: http://www.unixodbc.org/doc/FreeTDS.html

There's a tool that comes with FreeTDS, tsql. Use it to test your connection string. It's a very bare bones tool and something of a pain. :-/

Finally, there's a similar question with other problems in StackOverflow: How do I configure pyodbc to correctly accept strings from SQL Server using freeTDS and unixODBC?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!