[Solved]Linking to QMYSQL driver



  • Hello,

    I recently installed Qt5.5 on a new machine with Ubuntu14.04 amd64 but I cannot load the mysql driver for my application. It is available but not loaded.
    "QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7"

    I used the following way to build the plugin:
    http://doc.qt.io/qt-5/sql-driver.html#qmysql

    Which worked without any errors, on my older machine I used Qt5.2 (or 5.1 not sure), anyway after that I had to create a symlink to load the driver "sudo ln -s x86_64-linux-gnu/libmysqlclient_r.so libmysqlclient_r.so.16" in /usr/lib

    using ldd in the plugin directory gives the following output:
    linux-vdso.so.1 => (0x00007fff597fe000)
    libmysqlclient.so.18 => /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 (0x00007f872309a000)
    libQt5Sql.so.5 => /home/adi/Qt/5.5/gcc_64/lib/libQt5Sql.so.5 (0x00007f8722e59000)
    libQt5Core.so.5 => /home/adi/Qt/5.5/gcc_64/lib/libQt5Core.so.5 (0x00007f8722714000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8722410000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f872204a000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f8721e31000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8721c2d000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8721a0e000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8721708000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f87214f2000)
    libicui18n.so.54 => /home/adi/Qt/5.5/gcc_64/lib/libicui18n.so.54 (0x00007f8721083000)
    libicuuc.so.54 => /home/adi/Qt/5.5/gcc_64/lib/libicuuc.so.54 (0x00007f8720cd5000)
    libicudata.so.54 => /home/adi/Qt/5.5/gcc_64/lib/libicudata.so.54 (0x00007f871f2ab000)
    libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f871f0a8000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f871eea0000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f871eb98000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f8723808000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f871e959000)

    Any suggestions?



  • I have solved the issue using the following post: https://forum.qt.io/topic/49710/solved-first-steps-and-mysql/10


Log in to reply
 

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