Pypyodbc:尝试连接到SQL Server时无法打开lib'FreeTDS':找不到文件'')错误 [英] Pypyodbc: Can't open lib 'FreeTDS' : file not found") error when trying to connect to SQL server
本文介绍了Pypyodbc:尝试连接到SQL Server时无法打开lib'FreeTDS':找不到文件'')错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在Mac上使用Pypyodbc连接到SQL Server,但出现以下错误:
I'm trying to connect to a SQL Server using Pypyodbc on Mac and I'm getting the following error:
pypyodbc.DatabaseError: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'FreeTDS' : file not found")
我已经安装了freeTDS和unixodbc
I have installed freeTDS and unixodbc
brew install unixodbc
brew install freetds
这是我的带有虚假数据的连接字符串:
and here is my connection String with dummy data:
connection_String = "Driver=FreeTDS;Server=123.12.12.12;tds_version=7.2;Database=db_db;Uid=username:pwd=password:port=1433"
推荐答案
检查您的/etc/odbcinst.ini,否则可能在/etc/unixODBC/odbcinst.ini下
Check your /etc/odbcinst.ini or it could be under /etc/unixODBC/odbcinst.ini
在您的连接字符串中,您有类似"DRIVER = FreeTDS"的内容,该文件中需要有一个条目,如下所示.您可能需要更改驱动程序的位置.
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
这篇关于Pypyodbc:尝试连接到SQL Server时无法打开lib'FreeTDS':找不到文件'')错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文