Qt World Summit: Submit your Presentation

Qt Mysql driver issue

  • Hello ,

    Its my first time using the Mysql driver in a project.
    So far i succesfully made the driver and used it into my project.
    The project works fine on my development pc but when i now want to make a release version and try to run it onto the server i get following error:

    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers:

    I added all the ddl's and the plugins folder in my realease foder.

    Anyone have an idea what the reason might be behind this error? I have been trying to find a solution surfing around but without succes.



  • Lifetime Qt Champion


    Did you also deploy the MySQL .dll files with your software ?

  • Hello,

    Sorry for the late reply i wasnt able to get to a pc during the wekend.

    these are the dll's i added :
    a folder with plugins that contanians sqldrivers folder with :

    • qsqlmysql.dll
    • qsqlmysqld.dll
      next to the folder i have :
    • my .exe
    • libgcc_s_dw2-1.dll
    • libstdc++-6.dll
    • libwinpthread-1.dll
    • Qt5Core.dll
    • Qt5Sql.dll

    Im unsure if i have all the ones you mean.

  • Lifetime Qt Champion

    You still don't have the MySQL dlls deployed (not the Qt driver, the .dlls that come from your MySQL installation).

    To help with deployment, you can use the windeployqt helper program.

  • @SGaist Hi, I have almost the same issue, my exe works fine on my computer not mattering on any folder that I use, I did use the windeployqt but how do I go about adding the mysql dlls on it with it? Or should I just paste the mysql.dll that you mention? wich dlls are?

    Thanks again

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Yes just copy the mysql.dll besides your application.

    You can check what .dlls are needed using Dependency Walker

Log in to reply