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. MySQL driver not loaded - Debian Jessie 32-bit

MySQL driver not loaded - Debian Jessie 32-bit

Scheduled Pinned Locked Moved General and Desktop
mysqldriversdriverdebianlibrary
5 Posts 3 Posters 3.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.
  • S Offline
    S Offline
    Stravinsky
    wrote on 12 Sept 2015, 10:23 last edited by
    #1

    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?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mehmetak
      wrote on 12 Sept 2015, 14:54 last edited by
      #2

      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

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 12 Sept 2015, 19:26 last edited by SGaist 9 Dec 2015, 19:26
        #3

        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

        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
        • S Offline
          S Offline
          Stravinsky
          wrote on 14 Sept 2015, 16:51 last edited by
          #4

          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?
          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 14 Sept 2015, 20:55 last edited by
            #5

            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 ?

            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

            3/5

            12 Sept 2015, 19:26

            • Login

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