Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Mysql plugin problem.

[SOLVED] Mysql plugin problem.

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CKurdu
    wrote on 28 Aug 2015, 18:18 last edited by CKurdu
    #1

    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)
    

    You reap what you sow it

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 28 Aug 2015, 20:25 last edited by
      #2

      Hi,

      You might be hitting this bug

      You can try applying this patch

      The guide is in the documentation here

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CKurdu
        wrote on 29 Aug 2015, 07:49 last edited by CKurdu
        #3

        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.

        You reap what you sow it

        1 Reply Last reply
        0
        • C Offline
          C Offline
          CKurdu
          wrote on 29 Aug 2015, 09:26 last edited by
          #4

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

          Thank you.

          You reap what you sow it

          1 Reply Last reply
          0

          1/4

          28 Aug 2015, 18:18

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved