title: How to set a DB connection timeout for a python/pyodbc/unixODBC/MS ODBC Driver 11 for SQL Server/Linux stack?
body: <p>I've been unable to find a documented way to set a timeout for the initial connection that actually works. I'm not asking about a "query timeout", but rather a timeout on an initial connection attempt in the case that the DB server is completely down or unreachable, and there's no response at all. By default, such connections appear to timeout after 255 seconds - is there a way to set a shorter timeout?</p>
  
  <p>Edit: for clarity, I should reiterate the stack here:</p>
  
  <ul>
  <li>python</li>
  <li>pyodbc</li>
  <li>unixODBC (not iODBC)</li>
  <li>MS ODBC Driver 11 for SQL Server (not FreeTDS)</li>
  <li>Linux</li>
  </ul>