We help IT Professionals succeed at work.

Connection to MySQL (3.51) fail

Medium Priority
Last Modified: 2012-05-11
Program (which is made using vs 2010) should take connection to intranet -server where
mysql database is located.
I've installed mysql-connector-odbc-3.51.28-winx64 to client computer and
connectionstring is:
"Driver={MySQL ODBC 3.51 Driver} ;Server=intraServer ;Port=3306;Option=3;Stmt=;Database=mydatabase;UID=root;"

But.. this connectionstring works if program is installed to windows 7 32bit but not using windows 7 64bit.

Does it matter that database -server is windows 2000 32bit?
Watch Question

Only the driver that you install needs to be specific to the operating system platform. Install the 32-bit connector for installation on 32-bit Windows and the 64-bit one for the 64-bit version.

Secondly, you also need to make sure that when you create the data source that you are creating it in the 64-bit ODBC repo (settings are stored in the registry of which 64-bit Windows machines have two, a 32-bit one and the 64-bit one). Depending on the platform of the application trying to use the data source (32 or 64) it will try access to corresponding registry. It will always work on 32-bit Windows cause the data source will only ever be created in one registry, the 32-bit one.
Unlock this solution and get a sample of our free trial.
(No credit card required)


"..wacky world of 64-bit .." indeed.

My computer is win 7 home pre 64 bit and
I created system dsn link (control panel-->admin.tool --> ODBC)  and connection to local database seems to be correct. Then I did put "Dsn=myDNSTes;Uid=root" to odbc-connectionstring.
When I tested query using that connection it takes more than 20 secons running simpe sql-query.

Same query using sqlyog - takes 0,02 second. This is amazing.

And after this ... every querys from program (using System.Data.Odbc -library) takes times
but under sqlyog everything works fine.
Is this  associated with windwos 64-bit registry.

Before dns -testing HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI had not sub key and queries
works fine. After testing I found sub key Data Source...
I removed it but it had't  effect.

Is there simple way to restore/clear odbc-settings to original.

Unlock this solution and get a sample of our free trial.
(No credit card required)


Now connection works but it's overly complicated way
when need to edit registry.

Thansk a lot for advices.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.