What's causing 'unable to connect to data source' for pyodbc?
问题 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 -p 1433 -U username -P password Connects to the server without a problem, however, from Python: import pyodbc pyodbc.connect(driver='{FreeTDS}', server='server', database='database', uid='username', pwd='password') Yields an error: pyodbc.Error: ('08001', '[08001] [unixODBC][FreeTDS][SQL Server]Unable to connect to data source (0)