1

i've got problem with launching qt app on another pc (without installed mysql/qt).

P.S. On my pc it works fine.

Error "Driver[mysql] not loaded".

I try to deploy same project with sqlite and it launches on another pc normally, so problem is in mysql drivers/libs. I think i need add mysql .dll(s) (or something like that) Also i've got qsqlmysql.dll in sqldrivers project folder.

What can i do to launch my program on another pc. I'll be thankful for all your answers.

  • Take a look at [How to run Qt 5 applications on other computers](http://stackoverflow.com/questions/16198649/how-to-run-qt-5-applications-on-other-computers-windows-7) –  Mar 27 '16 at 14:13
  • And [here](http://stackoverflow.com/search?q=Error+%22Driver%5Bmysql%5D+not+loaded%22) –  Mar 27 '16 at 14:17

1 Answers1

1

Database drivers are plugins. Either you forgot to provide them with your program, or you've put the plugins in a wrong folder. What you should do is use the qtwindeploy utility which is a part of Qt package. qtwindeploy will analyze the dependencies of your application and will automatically copy all the necessary Qt modules and plugins.

Here's a usage example from one of my projects:

windeployqt.exe --force --no-translations --release --no-compiler-runtime --no-angle binaries\32\FileCommander.exe

It will put all the necessary Qt modules into the same folder where the target exe is. Or you can specify another directory with the --dir <dir path> option. And don't forget the MSVC runtime.

Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335