0
votes

I am trying to connect to MySQL database using Delphi Xe5 and fire monkey mobile application. I am using an TSQLConnection to connect to the database but i get an error DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, of the wrong version, or the driver may be missing from the system path.

I have read the below articles of which none had a solution that worked.

Articles:

DBX Error: Driver could not be properly initialised

http://wiltonsoftware.com/posts/view/getting-embarcadero-dbexpress-mysql-working-dbx-error-driver-not-initialized

None of their solutions seem to work, i use delphi xe5 on Windows 64x. I have tried downloading the zip file libmysql.dll and coppied into the following paths mentioned but to no avail.

C:\Users\Public\Documents\RAD Studio\12.0\Bpl
C:\Program Files (x86)\Embarcadero\RAD Studio\12.0\bin

Can anybody please assist me in understanding why i am not able to connect to my MySQL database?

1
MySql works fine for me on XE4 and XE6 (don't have XE5) on Win7-64bit. However, I did a full install of mySql 5.6 from their website, I didn't just d/load the DLL. The full install installs a mySql server service. Maybe you should try the full install if you haven't already.MartynA
Btw, your error message is the standard generic one from DBX and just seems to mean "something went wrong somewhere". I'm not suggesting you switch to FireDAC, but you might try connecting to your db using a FireDAC connection, because FireDAC's error messages tend to be a bit more specific and helpful than DBX's and might lead you straight to the problem if it's a configuration one (FD did yesterday for me with IB).MartynA
@martynA I am installing mysql now to see if the problem is resolved. If it does not work i will use firedac and see if that helps. Thank youMarcel
@martynA The FDConnection connects without a problem.Marcel
Good. I've written what I said up as an answer because people come here looking for answers and don't always seem to notice when the solution is in the comments.MartynA

1 Answers

0
votes

Your error message

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

is the standard generic one from DBX and just seems to mean "something went wrong somewhere". Error-reporting doesn't seem to be DBX's strong point; a couple of times recently I've had that error when the problem turned out to be quite different than it might lead you to expect. What's annoying about it is that I only found out because I happened to have "Break on exception" turned on in the IDE and could see that the initial exception came with quite different and more revealing info, but the DBX driver seems to re-raise with that text entirely replaced by its generic, info-free version, at least in the circumstances I ran into.

AS you've subsequently found out, a FireDAC connection may succeed in connecting where a DBX one fails, and even where it fails, its error messages are more specific than DBX's. It's a shame because I find FD more fidly to set up (like I always forget its SqlWait component and it doesn't tell me that I have until r/time). So, I'm not suggesting anyone should switch to FireDAC if they've already got DBX working on a given database, just that FD can be a useful diagnostic tool.