Linux Open Suse" pyodbc.Error:('01000'," [01000] [unixODBC] [Driver Manager]无法打开lib'SQL Server':找不到文件(0)(SQLDriverConnect)")" [英] Linux Open Suse "pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)")"
问题描述
我知道以前曾问过这个问题,但是我从来没有真正得到能够解决我的问题的正确答案.我正在尝试从Linux Open Suse12.4计算机连接到Windows计算机上的SQL Server.
I know this question was asked before but I never really got a proper answer that would solve my problem. I am trying to connect to a SQL server on a windows machine from a linux Open Suse12.4 machine.
pyodbc.connect('DRIVER={SQL Server};SERVER=servername;DATABASE=dbname;UID=userid;PWD=password')
我得到的确切错误如下:
the exact error I got was as below:
pyodbc.Error :("01000","[01000] [unixODBC] [驱动程序管理器]无法打开lib'SQL Server':找不到文件(0)(SQLDriverConnect))
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)")
和下面是我的odbcinst.ini文件:
and below is my odbcinst.ini file :
[Easysoft ODBC-SQL Server]
Driver=/usr/local/easysoft/sqlserver/lib/libessqlsrv.so
Setup=/usr/local/easysoft/sqlserver/lib/libessqlsrvS.so
Threading=0
FileUsage=1
DontDLClose=1
UsageCount=2
[Easysoft ODBC-SQL Server SSL]
Driver=/usr/local/easysoft/sqlserver/lib/libessqlsrv_ssl.so
Setup=/usr/local/easysoft/sqlserver/lib/libessqlsrvS.so
Threading=0
FileUsage=1
DontDLClose=1
UsageCount=2
推荐答案
Pyodbc无法找到Driver = {SQL Server}.就我而言,主要是因为我在odbcinst.ini文件和相关文件中输入的名称不正确.
Pyodbc is not able to locate Driver = {SQL Server} used. In my case, It was mainly because the name I gave in odbcinst.ini file and related files wasn't correct.
代替 驱动程序=/usr/local/lib/libmsodbcsql.13.dylib;在连接中使用uri帮助我进行了连接,因此了解我的配置文件不正确.
Instead using Driver =/usr/local/lib/libmsodbcsql.13.dylib; using in connection uri helped me connect and hence understand that my configuration files were incorrect.
- 用于连接到安装的SQL Server的库的不同类型,这会导致冲突.
我已更正并能够连接.
这篇关于Linux Open Suse" pyodbc.Error:('01000'," [01000] [unixODBC] [Driver Manager]无法打开lib'SQL Server':找不到文件(0)(SQLDriverConnect)")"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!