title: Trouble connecting tsql to SQL Server
body: <p>I'm trying to connect to a network SQL server from a 64 bit linux machine (ubuntu).  I think I've configured my freetds.conf, odbc.ini, and odbcinst.ini correctly. But tsql gives me an error connecting.</p>
  
  <p>I've tried following this link's instructions: </p>
  
  <p><a href="http://www.tryolabs.com/Blog/2012/06/25/connecting-sql-server-database-python-under-ubuntu/" rel="nofollow">http://www.tryolabs.com/Blog/2012/06/25/connecting-sql-server-database-python-under-ubuntu/</a></p>
  
  <p>Yet, the command 'tsql -H {SQL Server IP address} -p 1433 -U {username} -P {password}' gives the following output:</p>
  
  <pre><code>locale is "en_US.UTF-8"
  locale charset is "UTF-8"
  using default charset "UTF-8"
  Msg 18456 (severity 14, state 1) from &lt;Sql Server Name&gt; Line 1:
      "Login failed for user '&lt;username&gt;'."
  Error 20002 (severity 9):
      Adaptive Server connection failed
  There was a problem connecting to the server
  </code></pre>
  
  <p>To '/usr/local/freetds/etc/freetds.conf' file, I've added:</p>
  
  <pre><code>[sqlserver]
      host = {SQL Server IP Address}
      port = 1433
      tds version = 8.0
  </code></pre>
  
  <p>The '/etc/odbc.ini' file contains:</p>
  
  <pre><code>[sqlserver]
  Driver      = freetds
  Description = MSSQL Server
  ServerName  = {SQL Server IP Address}
  Port        = 1433
  Trace       = No
  Database    =
  TDS_Version = 8.0
  </code></pre>
  
  <p>The '/etc/odbcinst.ini' file contains:</p>
  
  <pre><code>[freetds]
  Description     = MS SQL database access with Free TDS
  Driver          = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
  Setup           = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
  UsageCount      = 1
  FileUsage       = 1
  </code></pre>
  
  <p>Some more details: If I use windows, MS-SQL Server uses my windows credentials to access the server.  It is also a 'trusted connection' (not sure what that means).</p>
  
  <p>I've done lots of searching, and have tried putting a copy of '.freetds.conf' in the home directory as well with no luck.</p>