Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. MySQL Driver not found (Qt5 MinGW32)

MySQL Driver not found (Qt5 MinGW32)

Scheduled Pinned Locked Moved Solved Installation and Deployment
22 Posts 3 Posters 5.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #21

    I forgot that Windows behaves differently, you have to add CONFIG += console to your .pro file to get a console attached to the output of your application.

    Use windeployqt to get the Qt dependencies of your application, then check with Dependency Walker if something fails. Then you should be good to go.

    To test that on your dev machine, rename the Qt folder before starting your application.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    starryeyedS 1 Reply Last reply
    1
    • SGaistS SGaist

      I forgot that Windows behaves differently, you have to add CONFIG += console to your .pro file to get a console attached to the output of your application.

      Use windeployqt to get the Qt dependencies of your application, then check with Dependency Walker if something fails. Then you should be good to go.

      To test that on your dev machine, rename the Qt folder before starting your application.

      starryeyedS Offline
      starryeyedS Offline
      starryeyed
      wrote on last edited by starryeyed
      #22

      @SGaist Thank you so much for clarification! I have managed to remove the dll from everywhere in the system except for the MySQL Connector C 6.1 folder in Program Files, which actually contains the dll that I've configured as a required library in .pro file.
      Now I'm struggling with a way to prevent database class from initializing before main(), which causes following errors to occur (copied from console output)

      QSqlDatabase: QMYSQL driver not loaded
      QSqlDatabase: available drivers:
      QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins
      

      I highly suspect that it will be enough to get rid of database *db = new database (); in the beginning of database.cpp.
      I have fixed that and now I deploy successfully.
      Infinite thanks for your patience and insights

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved