问题
I have FreeTDS, unixODBC in my python 3.6.1 installation I'm trying to get pyodbc connected to my sql server (local VM) . I have tried the following to test configuration of freetds
tsql -S servername -U pydata
I get the following message
Error 20012 (severity 2): Server name not found in configuration files. locale is "en_US.UTF-8" locale charset is "UTF-8" using default charset "UTF-8" Error 20013 (severity 2): Unknown host machine name. There was a problem connecting to the server
however if I use tsql -S 10.0.0.123 -U pydata -P password i connect just fine with no issues. I have triple checked the Freetds.conf file as well as the odbc.ini and odbcinst.ini files.
Anyone have any ideas why my entry for the server is not working?
来源:https://stackoverflow.com/questions/44167524/pyodbc-on-mac-connection-issues