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]QMYSQL driver not loaded ERROR [UBUNTU OS]
QtWS25 Last Chance

[SOLVED]QMYSQL driver not loaded ERROR [UBUNTU OS]

Scheduled Pinned Locked Moved General and Desktop
mysqldrivernotloadederrorubuntulinuxqsqlqmysql
6 Posts 2 Posters 5.2k 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.
  • G Offline
    G Offline
    Gue00
    wrote on 2 Oct 2015, 16:12 last edited by Gue00 10 Mar 2015, 14:56
    #1

    Hi, folks
    This is my first topic, so i hope i can find my solution here.

    QCoreApplication app(argc, argv);
    
    QSqlDatabase db( QSqlDatabase::addDatabase( "QMYSQL" ) );
    
    return app.exec();
    

    When i try to execute this code, i'm gettin this error :

    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLİTE QMYSQL .......

    I've read lots of topic about this err. but i can't fix it

    Qt5 mysql dev and lib packs installed even Qt4
    qmake installed

    OS : Ubuntu 15.04.1
    Qt Version : 5.5.0
    MySql Version : 5.6.25-0ubuntu0.15.04.1

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

      Hi and welcome to devnet,

      You should run ldd on the libqsqlmysql.so plugin to see what version of MySQL it's searching.

      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
      • G Offline
        G Offline
        Gue00
        wrote on 2 Oct 2015, 16:32 last edited by
        #3

        Thank, you for reply.

        OUTPUT:

        gue@gue-linux:~$ ldd /home/gue/Qt5.5.0/5.5/gcc_64/plugins/sqldrivers/libqsqlmysql.so
        linux-vdso.so.1 => (0x00007ffe235aa000)
        libmysqlclient_r.so.16 => not found
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f0e1f228000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f0e1eff0000)
        libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f0e1edd0000)
        libssl.so.10 => not found
        libcrypto.so.10 => not found
        libQt5Sql.so.5 => /home/gue/Qt5.5.0/5.5/gcc_64/plugins/sqldrivers/../../lib/libQt5Sql.so.5 (0x00007f0e1eb90000)
        libQt5Core.so.5 => /home/gue/Qt5.5.0/5.5/gcc_64/plugins/sqldrivers/../../lib/libQt5Core.so.5 (0x00007f0e1e448000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0e1e228000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0e1df18000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0e1dc10000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0e1d9f8000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0e1d628000)
        libicui18n.so.54 => /home/gue/Qt5.5.0/5.5/gcc_64/plugins/sqldrivers/../../lib/libicui18n.so.54 (0x00007f0e1d1b8000)
        libicuuc.so.54 => /home/gue/Qt5.5.0/5.5/gcc_64/plugins/sqldrivers/../../lib/libicuuc.so.54 (0x00007f0e1ce08000)
        libicudata.so.54 => /home/gue/Qt5.5.0/5.5/gcc_64/plugins/sqldrivers/../../lib/libicudata.so.54 (0x00007f0e1b3d8000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0e1b1d0000)
        libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f0e1afc8000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f0e1adc0000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f0e1aab0000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0e1f660000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f0e1a840000)

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Gue00
          wrote on 2 Oct 2015, 19:37 last edited by
          #4

          OK, i handeled it.
          Thank you so much :)

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 2 Oct 2015, 19:48 last edited by
            #5

            You're welcome !

            You had the version 18 of the libmysqlclient_r library ?

            Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

            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
              SGaist
              Lifetime Qt Champion
              wrote on 3 Oct 2015, 20:36 last edited by
              #6

              Re-building the plugin to use your currently installed libmysqlclient_r would be the simple and easy path. Just grab the sources and follow the instruction in the database part of Qt's documentation.

              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

              1/6

              2 Oct 2015, 16:12

              • Login

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