PDA

View Full Version : mysql driver not loaded after deployment



tpf80
26th August 2008, 22:21
I created a program that uses mysql 5.0, and it works perfectly on my windows XP test machine.

Once I copied the program to another windows XP computer and ran it, the program works fine except I get the infamous "driver not loaded" message when I attempt to access the database. From my reading, most of the posts regarding this error are in relation to the driver not being compiled correctly, however, I assume that since it works flawlessly on my test machine, that the driver is in fact compiled fine. I ran the program and monitored file access with filemon, and can not seem to see anything that I forgot to include with the program when I copied it to the other machine. The files I copied to the machine that gives the error are:



libmySQL.dll
mingwm10.dll
qsqlmysql4.dll
QtCore4.dll
QtGui4.dll
QtSql4.dll
qsqlmysqld4.dll
program.exe


Are there any other files that I am missing that should be there for MySql to work?

tpf80
26th August 2008, 22:39
looks like I figured it out, it appears that the "qsqlmysql4.dll" has to be in a subdirectory called "sqldrivers" which is under the main .exe's directory. I made that change and it works fine.

jcbmca
4th February 2010, 23:01
Thank you, thank me the recipe works great.

d_stranz
14th April 2010, 20:55
Thank you, thank you. After 4 hours of beating my head against the PC and reading page after page of documentation and forum notes, I found this one.

For those "Gurus" who always reply: "Read the Docs", SHOW ME WHERE in the Qt documentation it explicitly says the SQL drivers have to be deployed in an "sqldrivers" subdirectory? There's some cryptic stuff about "The Plugin Directory" in the "Deploying Plugins" topic, but could they include a simple table that says something like "If your plugin is this type it goes in this subdirectory"? Nooooooo. :mad:

Nightfox
4th September 2011, 10:12
You said it d_stranz. Reading this post solved my problem too after reading numerous of posts. Deploying apps with sql driver remains one of the most difficult tasks with very complicated docs that sometimes raise more confusion than solutions.