[Solved] Qt 5.3.2 QMYSQL driver not loaded



  • hi !
    I've installed in a pc with Mint 17 Qt 5.3.2 with the installer. File libqsqlmysql.so has been generated during installation and it is in the right place. But when I try to connect with mysql db i receive a message "QMYSQL driver not loaded". So, from the source I've generated a new libqsqlmysql.so; the command ldd libqsqlmysql.so has given this output:

    @
    linux-gate.so.1 => (0xb77ab000)
    libmysqlclient.so.18 => /usr/lib/i386-linux-gnu/libmysqlclient.so.18 (0xb7454000)
    libQt5Sql.so.5 => /home/achille/Qt/5.3/gcc/lib/libQt5Sql.so.5 (0xb7412000)
    libQt5Core.so.5 => /home/achille/Qt/5.3/gcc/lib/libQt5Core.so.5 (0xb6ed7000)
    libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb6dee000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb6c3e000)
    libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb6c24000)
    libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb6c1e000)
    libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb6c02000)
    libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb6bbc000)
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb6b9f000)
    libicui18n.so.52 => /home/achille/Qt/5.3/gcc/lib/libicui18n.so.52 (0xb6975000)
    libicuuc.so.52 => /home/achille/Qt/5.3/gcc/lib/libicuuc.so.52 (0xb67f8000)
    libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0xb67f5000)
    librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb67ec000)
    libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb66e0000)
    /lib/ld-linux.so.2 (0xb77ac000)
    libicudata.so.52 => /home/achille/Qt/5.3/gcc/lib/libicudata.so.52 (0xb5074000)
    libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb5035000)
    @
    I moved the new libqsqlmysql.so in the right place but doesn't work.
    I don't know why it's so difficult and what I have to do; in other pc, with Qt 4.8 it was very very easy to connect with a mysqldb.
    Thanks in advance for helping

    [edit: added coding tags @ for better readability SGaist]


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you check the error message from QSqlDatabase ?



  • thank you for your answer;
    ok,if I use libqsqlmysql.so from default installation I received this message:

    @QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
    @
    otherwise, if I use libqsqlmysql.so generated from source no message, but db is not connected.



  • Sorry, I was so stupid.... I din't create a test db correctly ....
    just only need build libqsqlmysql.so from mysql.pro (qmake, make) in
    @Qtpath/5.3/Src/qtbase/src/plugins/sqldrivers/mysql@
    and move it from
    @Qtpath/5.3/Src/qtbase//plugins/sqldrivers@
    in which is created to
    @Qtpath/5.3/gcc/qtbase/plugins/sqldrivers@
    Good bye !


  • Lifetime Qt Champion

    Don't worry that can happen

    Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)


Log in to reply
 

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