我在CentOS上使用pyodbc和Microsoft SQL Server数据库。事情很好但突然间我开始得到'08S01', '[08S01] [Microsoft][ODBC Driver 11 for SQL Server]Communication link failure (0) (SQLExecDirectW)'
。我寻找解决方案,并获得了数据库性能问题,网络连接问题的建议,我检查并正常工作。它甚至不会生成跟踪文件。
我的配置
/etc/odbc.ini
[sqlserver]
TraceFile = /tmp/odbc.trace
Trace = 1
Driver=FreeTDS
Description=ODBC connection via FreeTDS
Server=***
Port=1433
ServerName=sqlserver
Database=***
odbci.ini
[sqlserver]
Driver = FreeTDS
Description = ODBC connection via FreeTDS
Host = ***
Port = 1433
ServerName = sqlserver
Database = ***
TraceFile = /tmp/odbc.log
Trace = Yes