Robert Brooks
Robert Brooks

Reputation: 11

mySQL ODBC 5.1 issue: Data source name not found and no default driver specified

I have searched this for several days now (including trying the solution from one link from this site) and I still cannot get this to work...

Problem: I converted an old Visual Studio 2005 project to 2010 on a Windows 7, 64 bit box. Everything works fine, including my ODBC connection to an Oracle database...however, I cannot connect to a mySQL database like I could with VS 2005 on a WinXP 32 bit box.

What I've tried: Uninstalling the 64 bit ODBC driver for MySQL with a 32 bit driver. I added this to my System DSN and the test connection works fine (from odbcad32.exe). All other instances of this driver are removed from the User DSN from both odbcad32 and the 64 bit odbc client. I cannot continue my project without accessing this database. I have tried everything from every website thread, and I still cannot find a solution.

I get this error:

The thread '' (0x1648) has exited with code 0 (0x0). A first chance exception of type 'System.Data.Odbc.OdbcException' occurred in System.Data.dll An ODBC exception occurred: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified A first chance exception of type 'System.NullReferenceException' occurred in App_Web_uoi23wal.dll

This is the connection string I am using:

mySqlConnectionString = "Driver={MySQL ODBC 5.1 Driver};Server=xx.xxx.xx.xx;Port=3306;Database=xxxx;User=xxxx;Password=xxxx;";

Can anyone please help me with this? I am at my wit's end! ;)

Thanks!

Upvotes: 1

Views: 13354

Answers (2)

Nag
Nag

Reputation: 1

This worked for me on MySQL 5.1

Data Sources (ODBC): - User DSN : delete the specified User DSN - System DSN : create a new System DSN Make sure you have only System DNS not both..

Upvotes: 0

Colin Steel
Colin Steel

Reputation: 1055

Couldn't find anyone else who has solved this, but I tried this and both worked for me. Original post is old but if anyone else reads this, possible solution for you.

"Driver={MySQL ODBC 5.2 ANSI Driver}; Server=localhost; Database=***; User=****; Password=****; Option=3;"
"Driver={MySQL ODBC 5.2 Unicode Driver}; Server=localhost; Database=***; User=****; Password=****; Option=3;"

Seems like you must actually specify the 'ANSI' or 'UNICODE' string instead of the 'w' or 'a' as has been suggested on other forums and threads. I presume its no coincidence that it is specified exactly like that in the ODBC Data Source Administrator menu (Control Panel -> System -> Administrative Tools -> Data Sources (ODBC) -> Drivers)

Upvotes: 4

Related Questions