title: How do I connect to my Amazon RedShift cluster using Python?
body: <p>I have the ODBC url to my Amazon RedShift cluster. I wrote a simple Python script to connect to the cluster, however the connection keeps failing.</p>
  
  <p>I have tried the following connection strings;</p>
  
  <p>1) <code>'Driver={SQL Server}; Server=$SERVER; Database=$DB; UID=$UID; PWD=$PWD; Port=5439'</code></p>
  
  <blockquote>
    <p><em>ERROR - 'pyodbc.Error: ('08001', '[08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. (17) (SQLDriverConnect); [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). (53); [01S00] [Microsoft][ODBC SQL Server Driver]Invalid connection string attribute (0)')'</em></p>
  </blockquote>
  
  <p>2) <code>'Driver={Amazon Redshift (x64)}; Server=$SERVER; Database=$DB; UID=$UID; PWD=$PWD; Port=5439'</code></p>
  
  <blockquote>
    <p><em>ERROR - 'pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')'</em></p>
  </blockquote>
  
  <p>Any help would be much appreciated. Thanks!</p>