0

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?

Sc-python-leaner
  • 259
  • 1
  • 2
  • 13
  • Check `tsql -C` to ensure that you are looking at the same freetds.conf directory that FreeTDS is using. Also, your `tsql` command is using the `servername` defined in freetds.conf, not a DSN name defined in odbc.ini, correct? – Gord Thompson May 24 '17 at 21:27
  • Awesome Gord Thompson, that was the problem. Why does this have to be so confusing? Well I am just learning this so.... Thank you again Gord Thompson – Sc-python-leaner May 26 '17 at 01:04

0 Answers0