QT5 mysql Driver not loaded (solved)



  • I've Installed QT creator + QT via the QT Maintenance Tool and after that I've installed the package "libqt5sql5-mysql" via apt-get. Its installed in "/usr/lib/i386-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so". Im running a Linux Mint Mate 17.

    When i start my Application i get the following Error: "Driver not loaded Driver not loaded".
    Why QT-Creator wont recognize mysql even if its installed in the qt5 dir.?


  • Lifetime Qt Champion

    Hi,

    Do you have the MySQL client libraries installed on your computer ?

    On a side note, it's Qt, QT stands for Apple QuickTime.



  • Define QT_DEBUG_PLUGINS=1 in your environment when you run your application. Qt will display debug information on it trying to load plugins. Look for issues regarding the loading of the mysql driver.



  • I solved it!
    @SGaist, yes i did but that wasnt the problem.
    @Andre, Thx for that info, i did as you adviced and saw that QT was looking for the lib in the wrong path.
    Because of the fact that I installed QT-Creator and libs via theQT Maintenance Tool all QT-Related Data was installed on /opt/QT...
    But I Installed the mysql lib via the repo so it was installed to /usr/lib/...
    So i moved the lib but got an error according the version. of the lib.
    Then i removed QT creator incl. libs via the maintenance tool and Installed it via the Repo. So everything works fine now.
    You just make sure that you install all via repo or all manually.


  • Lifetime Qt Champion

    When using Qt from the installer you can have a mismatch between the MySQL client libraries from your system and the one used to build the plugin. In that case you can simply rebuild the plugin


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.