[SOLVED] Mysql plugin problem.



  • I always encounter the same problem. I was upgrading Qt to new version and then QMysql plugin didn't work because compatible mysql library version didn't exist on my opensuse 13.2 OS. So I was downloading the Qt source code and I found the mysql driver plugin in source code of qt and I compiled the qmysql plugin into compatible mysql library version. This is frustrating. Now I upgraded Qt into 5.5 but I didn't be successful on recompiling Qmysql plugin. Is there a simple solution or is there any guide for QMysql plugin compiling in Qt 5.5.

    ldd libqsqlmysql.so 
            linux-vdso.so.1 (0x00007ffd226a0000)
            libmysqlclient_r.so.16 => not found
            libz.so.1 => /lib64/libz.so.1 (0x00007fc19c948000)
            libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fc19c708000)
            libnsl.so.1 => /lib64/libnsl.so.1 (0x00007fc19c4f0000)
            libssl.so.10 => not found
            libcrypto.so.10 => not found
            libQt5Sql.so.5 => /home/ckurdu/bin/Qt/5.5/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007fc19c2b0000)
            libQt5Core.so.5 => /home/ckurdu/bin/Qt/5.5/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007fc19bb68000)
            libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc19b948000)
            libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fc19b640000)
            libm.so.6 => /lib64/libm.so.6 (0x00007fc19b338000)
            libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc19b120000)
            libc.so.6 => /lib64/libc.so.6 (0x00007fc19ad78000)
            libicui18n.so.54 => /home/ckurdu/bin/Qt/5.5/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.54 (0x00007fc19a908000)
            libicuuc.so.54 => /home/ckurdu/bin/Qt/5.5/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.54 (0x00007fc19a558000)
            libicudata.so.54 => /home/ckurdu/bin/Qt/5.5/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.54 (0x00007fc198b28000)
            libdl.so.2 => /lib64/libdl.so.2 (0x00007fc198920000)
            libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007fc198718000)
            librt.so.1 => /lib64/librt.so.1 (0x00007fc198510000)
            libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fc198200000)
            /lib64/ld-linux-x86-64.so.2 (0x00007fc19cda8000)
            libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007fc197f90000)
    

  • Lifetime Qt Champion

    Hi,

    You might be hitting this bug

    You can try applying this patch

    The guide is in the documentation here

    Hope it helps



  • I have Qt 5.5 on Opensuse Linux 13.2. I did things based on the guide you specified.

    Firstly I downloaded source codes of qt5 like below.

    git clone https://code.qt.io/qt/qt5.git
    cd qt5
    git checkout 5.5
    perl init-repository
    

    Then based on guide in path "/virtualbox/temp/qt5/qtbase/src/sql/drivers/mysql>"

    ~/bin/Qt/5.5/gcc_64/bin/qmake "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" qsql_mysql.pri
    make
    

    and this is the result.

    g++ -c -pipe -I/usr/include/mysql -O2 -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I/home/ckurdu/bin/Qt/5.5/gcc_64/include -I/home/ckurdu/bin/Qt/5.5/gcc_64/include/QtGui -I/home/ckurdu/bin/Qt/5.5/gcc_64/include/QtCore -I.moc -I/usr/include/libdrm -I../../../../mkspecs/linux-g++ -o .obj/qsql_mysql.o qsql_mysql.cpp
    qsql_mysql.cpp:36:40: fatal error: QtSql/private/qsqldriver_p.h: No such file or directory
     #include <QtSql/private/qsqldriver_p.h>
                                            ^
    compilation terminated.
    Makefile:704: recipe for target '.obj/qsql_mysql.o' failed
    make: *** [.obj/qsql_mysql.o] Error 1
    
    

    What am I doing wrong? Sorry for my broken English.



  • Sorry for my stupidity. I used the wrong path. It must be "qt5/qtbase/src/plugins/sqldrivers/mysql".

    Thank you.


Log in to reply
 

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