title: pyodbc connecting to named instance
body: <p>I've been tearing my hair out trying to pin point the error when connecting to a SQL Server named instance using pyodbc on a linux box. I can connect fine when connecting to other SQL Servers that are not using a named instance. The example below works on a server without a named instance:</p>
  
  <pre><code>import pyodbc
  
  DB_WMS_NJ62 = 'DRIVER={ODBC Driver 13 for SQL Server};SERVER=xxx.xxx.xxx.xxx;PORT=1433;DATABASE=dbname;UID=dbuserid;PWD=dbpass'
  conn = pyodbc.connect(DB_WMS_NJ62)
  </code></pre>
  
  <p>This connects correctly and allows me to execute queries.</p>
  
  <p>Below is my problematic code.  Changing the IP, adding a named instance, and changing to the designated port 63810</p>
  
  <pre><code>import pyodbc
  
  DB_WMS_ONTMOD2 = 'DRIVER={ODBC Driver 13 for SQL Server};SERVER=xxx.xxx.xxx.xxx\\fontanasql;PORT=63810;DATABASE=dbname;UID=dbuserid;PWD=dbpass'
  conn = pyodbc.connect(DB_WMS_ONTMOD2)
  </code></pre>
  
  <p>Running the above, i receve the error:</p>
  
  <pre><code>pyodbc.OperationalError: ('HYT00', '[HYT00] [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')
  </code></pre>
  
  <p>Any help appreciated.</p>
  
  <p>Resolution:
  Gord Thompson's suggestion worked. Those were my exact mistakes.
  Thank you so much!</p>