MySql Deploy App....HELP!!
-
Hello this is my first post but I am in dire need of some help. I have created an application in creator using qt 5.5.1 and visual studio 2013. It connects to a remote MySql Database and when I run it from creator it works fine. When I go to the build release directory and run it it works perfectly.....However When I use windepolyqt (I think that is the name of the tool) and to create an installation folder and I run it the app works fine but I get "driver not loaded driver not loaded" error when I try to connect to the database. I do have the qsqlmysql.dll in the sqldrivers folder. I have been working on this for the last 36 hours and can't figure and I desperately need to deploy this to several machines quickly. Any help would be greatly appreciated!!!!!
-
Hi, I'm guessing, windeployqt is a fine tool but for database programs it forgets to copy Q5Sql.dll, that could be cause of your problem. When starting windeployqt, try adding the -sql switch, like this:
windeployqt -sql yourapp.exe
@hskoglund Thanks for the reply but QT5Sql.dll it did copy QT5Sql.dll into the application directory.
-
Hi and welcome to devnet,
Do you also have the MySQL client libraries deployed with your application ?
-
Ok. You could try debugging, turn on a trace when Qt loads the plugins.
Before starting your app, set an environment variable to enable the trace:
SET QT_DEBUG_PLUGINS=1
To see the trace output, you can download the DebugView program
-
Hi and welcome to devnet,
Do you also have the MySQL client libraries deployed with your application ?
-
Don't put anything in the windows folder. Next step is what @hskoglund suggested
-
The question is going to be silly but: Are you instantiating a QApplication (or Gui or Core) as the first thing in your main function ?
-
Can you check what QCoreApplication::libraryPaths(); returns ?
-
Hi, one more thing you could try (since your app runs fine when launched from Qt Creator):
define the environment variable (SET QT_DEBUG_PLUGINS=1) also in Qt Creator (in the Projects Tab, you can set it in Build Environment) then start your app and compare the trace output to the one you got with errors before. -
Here's another: try skipping using windeployqt; instead switch to using manual deployment, use this nice guide
-
Here's another: try skipping using windeployqt; instead switch to using manual deployment, use this nice guide
@hskoglund Ok tried it Same Thing!!
-
@shathcock Nope same thing!!!
-
Hmmmm, if I understand correctly: you have 2 directories/folders with identical contents but in different places on your C: drive. When you doubleciick to launch your app in one of them everything is fine and dandy, but when you try doubleclicking your app in the other directory you get that mysql plugin loading error?