I have Python 2.7, MySQL 5.5, MySQL ODBC Connector 5.1, and pyodbc all installed on my computer, which is running Windows 7, 64-bit...
Only problem is that everything is installed as 64-bit except pyodbc, which is 32-bit.
When using easy_install to download pyodbc, it automatically downloads the 32-bit version. Thus, when I try to connect to my database using:
cnxn = pyodbc.connect('DRIVER={MySQL ODBC 5.1 DRIVER};SERVER=localhost;DATABASE=test;UID=root;PWD=password')
I get the error:
Data source name not found and no default driver specified (0) (SQLDriverConnect)
And when I try to specify a DSN with:
cnxn = pyodbc.connect('DSN=dsn_name;etc...')
I get the error:
The specified DSN contains an architecture mismatch between the Driver and Application (0) (SQLDriverConnect)
This link tells me that this is due to the 32/64-bit mismatch, as expected: http://msdn.microsoft.com/en-us/library/windows/desktop/ms712362(v=vs.85).aspx
So I have two questions:
1) Is it possible to force easy_install to download the 64-bit pyodbc, or is it possible to download the 64-bit pyodbc manually?
2) If the above is not possible, is it possible to configure the DSN to allow for this using the Microsoft ODBC Data Source Administrator window.
Thanks.