What's causing 'unable to connect to data source' for pyodbc?

前端 未结 13 2114
北荒
北荒 2020-12-28 14:34

I\'m trying to connect to an MSSQL database from python on Linux (SLES).

I have installed pyodbc and Free TDS. From the command line:

tsql -H server          


        
13条回答
  •  礼貌的吻别
    2020-12-28 15:23

    Just for an extra datapoint, odbc.ini is empty on my host, and odbcinst.ini has the following lines:

    # Driver from FreeTDS
    #
    [FreeTDS]
    Driver = /usr/lib64/libtdsodbc.so.0
    

    last, the freetds.conf file has these lines:

    [global]
        host= 
        port= 
        tds version = 8.0
    

    While one can certainly specify option settings in odbc.ini, doing it this way allows the configuration options to all be managed where you'd expect them -- the freetds.conf file.

提交回复
热议问题