title: freetds and pyodbc failing to connect
body: <p>I'm currently working on setting up a connection from a Linux box to a Microsoft SQL server. I have installed FreeTDS and pyodbc on the Linux box.</p>
  
  <p>I have set up the following files:
  /etc/freetds/freetds.conf</p>
  
  <pre><code>[sqlserver]
      host = &lt;ip address&gt;
      port = 1433
      tds version = 8.0
      client charset = UTF-8
  </code></pre>
  
  <p>~/.odbc.ini</p>
  
  <pre><code>[sqlserver]
  Description     = FreeTDS MSSQL
  Driver          = FreeTDS
  Servername      = &lt;same ip as above&gt; 
  Database        = Reports
  TDS_Version     = 8.0
  </code></pre>
  
  <p>/etc/odbcinst.ini</p>
  
  <pre><code>[FreeTDS]
  Description             = FreeTDS MSSQL
  Driver                  = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
  Driver64                = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
  Setup                   = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
  Setup64                 = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
  UsageCount              = 1
  CPTimeout               = 
  CPTimeToLive            = 
  DisableGetFunctions     = 
  DontDLCLose             = 
  ExFetchMapping          = 
  Threading               = 
  FakeUnicode             = 
  IconvEncoding           = 
  Trace                   = 
  TraceFile               = 
  TraceLibrary            = 
  </code></pre>
  
  <p>When I attempt to run tsql -S sqlserver -U username -P password, I get the following error:</p>
  
  <pre><code>locale is "en_US.UTF-8"
  locale charset is "UTF-8"
  using default charset "UTF-8"
  Msg 18452 (severity 14, state 1) from SYMPLECTIC03 Line 1:
      "Login failed. The login is from an untrusted domain and cannot be used with Windows authentication."
  Error 20002 (severity 9):
      Adaptive Server connection failed
  There was a problem connecting to the server
  </code></pre>
  
  <p>I also tried connecting with pyodbc, in the following script:</p>
  
  <pre><code>import pyodbc
  try:
      cnxn = pyodbc.connect('DRIVER=FreeTDS;SERVER=same_ip_as_above;DATABASE=Reports;UID=myusername;PWD=mypassword')
  except pyodbc.Error, err:
      print err
  </code></pre>
  
  <p>which prints the following error:</p>
  
  <pre><code>('001', '[001] [nxDC[reD]SLSre]nbet onc odt ore (0) (SQLDriverConnect)')
  </code></pre>
  
  <p>Not exactly the most helpful error message.</p>
  
  <p>Is there anything I am doing wrong when trying to connect?</p>
  
  <p>As a side note, our db requires Windows authentication, not integrated.
  I can telnet to connect to the host, so that's not the issue either.</p>