Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Have some problems using mysql in qt5.7



  • Thank you very much!
    I think qt is short of mysql driver. I've been working on it for two days but what googles says always don't suit my situation.
    When running a program with mysql, it says:
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7

    I tried this
    but when "qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/mysql -lmysqlclient_r" mysql.pro"
    it tells me "qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory"
    But I don't figure out what it means.
    What should I do? Thanks a lot !


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You are calling the wrong qmake version. You should use the full path to your Qt 5.7 qmake.


Log in to reply