delphirules
delphirules

Reputation: 7390

Delphi DBX and MySQL connection nightmare : DBX Error: Driver could not be properly initialized

Ok, in the past i had a huge headache to make DBX work with MySQL. In such episode i was trying to make it work with Delphi 2007 and i lost days looking for the right libmysql.dll and dbxmys.dll combination, trying dozens until i found one couple that worked.

Now i have the same issue this time in Delphi XE. The same libraries used for D2007 does not work with XE, returning the very known infamous error :

DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, of the wrong version, or the driver maybe be missing from the system path...

Both libraries are in the app path and both work in an app compiled with D2007, but not with the same app compiled in XE.

So i'd like to save some days of research if someone already had this issue and found a combination of libraries that work with Delphi XE.

Thanks in advance !

Upvotes: 2

Views: 20280

Answers (2)

Karl Hoener
Karl Hoener

Reputation: 1

I have seen this issue a number of times and spent a few days moving LibMySQL.dll all over the place to find a configuration that works. Here's the thing - if you installed MySQL server x32, you will not have much trouble. Just follow the instructions posted everywhere.

But, if you installed MySQL Server x64 (or Oracle, SQL Server...) - you will be having all kinds of trouble. The IDE for Delphi (whatever version) is x32. The x64 LibMySQL.dll will not work within the IDE no matter what you do and only the x64 projects you build will connect at runtime. The solution is simple - download the x32 version of MySQL and get the LibMySQL.dll for x32. Put the x32 version in the Delphi/Bin directory - now your connections will work within the IDE (whether you are creating x32 or x64 applications - the IDE is always x32).

Now that you have both x32 and x64 versions of LibMySQL.dll, put the appropriate one in Windows/System32 and SysWow64 folders. You are good to go - no "special" version of the dll is required.

Upvotes: 0

Related Questions