title: Connecting to MS SQL Server using python on linux with 'Windows Credentials'
body: <p>Is there any way to connect to an MS SQL Server database with python on linux using Windows Domain Credentials?</p>
  
  <p>I can connect perfectly fine from my windows machine using Windows Credentials, but attempting to do the same from a linux python with pyodbs + freetds + unixodbc </p>
  
  <pre><code>&gt;&gt;import pyodbc
  &gt;&gt;conn = pyodbc.connect("DRIVER={FreeTDS};SERVER=servername;UID=username;PWD=password;DATABASE=dbname")
  </code></pre>
  
  <p>results in this error:</p>
  
  <pre><code>class 'pyodbc.Error'&gt;: ('28000', '[28000] [unixODBC][FreeTDS][SQL Server]Login incorrect. (20014) (SQLDriverConnectW)')
  </code></pre>
  
  <p>I'm sure the password is written correctly, but I've tried many different combinations of username:</p>
  
  <pre><code>DOMAIN\username
  DOMAIN\\username
  </code></pre>
  
  <p>or even</p>
  
  <pre><code>UID=username;DOMAIN=domain
  </code></pre>
  
  <p>to no avail. Any ideas?</p>