QtCreator cannot load QMYSQL driver



  • Hi everyone!
    I need to visit mysql ,and I just write a small test program to test it . I can build my program but when I clicked run button it remind me :
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
    Unable to open database

    And some more infomation may be help:

    fjy@ubuntu:~$ locate libqsqlmysql.so
    /home/fjy/Qt5.4.0/5.4/gcc/plugins/sqldrivers/libqsqlmysql.so
    /home/fjy/Qt5.4.0/Tools/QtCreator/bin/plugins/sqldrivers/libqsqlmysql.so
    /usr/lib/i386-linux-gnu/qt4/plugins/sqldrivers/libqsqlmysql.so
    I have copied this *.so file to the libpath of qt.ANd my system is ubuntu 32bit.

    The Qt version is Qt Creator 3.3.0(opensource) based on Qt 5.4.0(GCC 4.6.1 32bit)

    I have use google to search this question ,but I still cannot solve it.

    Holp someone could give some advice!
    Thank you!


  • Moderators

    Hi,

    Your system may be missing MySQL libraries.
    Check whether libqsqlmysql.so's dependencies are resolved
    @
    ldd /home/fjy/Qt5.4.0/5.4/gcc/plugins/sqldrivers/libqsqlmysql.so
    @



  • How about showing the code on how you open the database


Log in to reply
 

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