MySQL driver not loaded - Debian Jessie 32-bit



  • Hello.

    I have apps which works correctly on WIN 7. I tried to run on Debian Jessie 32-bit and i have output:

    ("/home/rafal/Qt/5.5/gcc/plugins", "/home/rafal/Dokumenty/QT_Workspace/Projekty/Furniture_APPS")
    QSqlError("", "Driver not loaded", "Driver not loaded")
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7

    I run ldd libqsqlmysql.so in path /home/rafal/Qt/5.5/gcc/plugins:
    linux-gate.so.1 (0xb770c000)
    libmysqlclient_r.so.16 => not found
    [link text](link url)libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb7389000)
    libcrypt.so.1 => /lib/i386-linux-gnu/i686/cmov/libcrypt.so.1 (0xb7357000)
    libnsl.so.1 => /lib/i386-linux-gnu/i686/cmov/libnsl.so.1 (0xb733e000)
    libssl.so.10 => not found
    libcrypto.so.10 => not found
    libQt5Sql.so.5 => /home/rafal/Qt/5.5/gcc/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0xb70b3000)
    libQt5Core.so.5 => /home/rafal/Qt/5.5/gcc/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0xb6b69000)
    libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xb6b4d000)
    libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb6a5b000)
    libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xb6a15000)
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb69f8000)
    libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xb684d000)
    libdl.so.2 => /lib/i386-linux-gnu/i686/cmov/libdl.so.2 (0xb6848000)
    libicui18n.so.54 => /home/rafal/Qt/5.5/gcc/plugins/sqldrivers/./../../lib/libicui18n.so.54 (0xb65cf000)
    libicuuc.so.54 => /home/rafal/Qt/5.5/gcc/plugins/sqldrivers/./../../lib/libicuuc.so.54 (0xb6427000)
    libicudata.so.54 => /home/rafal/Qt/5.5/gcc/plugins/sqldrivers/./../../lib/libicudata.so.54 (0xb4bfc000)
    libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0xb4bf8000)
    librt.so.1 => /lib/i386-linux-gnu/i686/cmov/librt.so.1 (0xb4bef000)
    libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb4ac7000)
    /lib/ld-linux.so.2 (0xb770f000)
    libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb4a56000)

    After that i tried this commands:

    ln -s libmysqlclient_r.so libmysqlclient_r.so.16
    ln -s libcrypto.so.1.0.0 libcrypto.so.10
    ln -s libssl.so.1.0.0 libssl.so.10

    ldd libqsqlmysql.so changed but still does not work MYSQL driver.

    Can someone help me?



  • How to Build the QMYSQL Plugin on Unix and Mac OS X

    You need the MySQL header files and as well as the shared library libmysqlclient.so. Depending on your Linux distribution you may need to install a package which is usually called "mysql-devel".

    Tell qmake where to find the MySQL header files and shared libraries (here it is assumed that MySQL is installed in /usr/local) and run make:

    cd $QTDIR/qtbase/src/plugins/sqldrivers/mysql
    qmake "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro
    make
    After installing Qt, you also need to install the plugin in the standard location:

    cd $QTDIR/qtbase/src/plugins/sqldrivers/mysql
    make install


  • Lifetime Qt Champion

    Hi,

    Don't do the linking yourself, you need to install the MySQL and OpenSSL dev packages, they will provide what you need.

    Once that done, check with ldd again to verify that all libraries are found correctly



  • I installed QT and MySQL. I'm confused about file location:

    First one:
    /usr/lib/i386-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so
    **
    Second one:**
    /usr/include/mysql/mysql.h

    Location of Qt:
    /home/rafal/Qt/5.5/gcc/plugins - i cant find here libmysqlclient.so.

    So:

    1. cd $QTDIR/qtbase/src/plugins/sqldrivers/mysql - is it First one?
    2. qmake "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro - Which location here?

  • Lifetime Qt Champion

    First location is the Qt MySQL plugin
    Second location is the MySQL header file

    Looks like you're trying to mix a system installed Qt with your own install of Qt. which one are you currently using ?



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