Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QMYSQL driver not loaded on Ubuntu

QMYSQL driver not loaded on Ubuntu

Scheduled Pinned Locked Moved Solved Installation and Deployment
61 Posts 5 Posters 79.0k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #48

    Yes , Solved !
    Thank you dear :)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #49

      You're welcome !

      Now that you have the plugin, can you 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
      • M Offline
        M Offline
        Malhar
        wrote on last edited by
        #50

        Hi SGaist,
        i too faced this error and i did ldd libmysqlclient_r.so.16 and installed the dependency but still m getting this error QMYSQL driver not found available drivers QSQLITE.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #51

          libmysqlclient_r.so.16 is the MySQL client library. What you should test is the Qt driver plugin. But based on available driver list, you don't have the MySQL plugin.

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

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            libmysqlclient_r.so.16 is the MySQL client library. What you should test is the Qt driver plugin. But based on available driver list, you don't have the MySQL plugin.

            M Offline
            M Offline
            Malhar
            wrote on last edited by
            #52

            @SGaist ok. Once i faced this problem and i solved installing dependency of .so file.
            Now what should i do then.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #53

              How did you install Qt ?

              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
              • M Offline
                M Offline
                Malhar
                wrote on last edited by
                #54

                using wget command "http://download.qt.io/archive/qt/5.1/5.1.0/qt-linux-opensource-5.1.0-x86_64-offline.run"

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #55

                  You're aware that the current version is 5.5.1, aren't you ?

                  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
                  • M Offline
                    M Offline
                    Malhar
                    wrote on last edited by
                    #56

                    yes i know about the latest version but my whole development is done on Qt5.1 so i dont want to change the version.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #57

                      Then you might have to build the plugin yourself.

                      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
                      • R Offline
                        R Offline
                        ram1111
                        wrote on last edited by ram1111
                        #58

                        Hello SGaist i'm a beginner to Qt.

                        i get and installed Qt 5.7 in x64 edition for ubuntu.
                        I have QTPLUGIN += qsqlmysql and QT += sql in file .pro

                        when i try connect QMYSQL i got Error like :-
                        QSqlDatabase: QMYSQL driver not loaded
                        QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
                        QSqlError("", "Driver not loaded", "Driver not loaded")

                        when i do
                        itas02@itas02:/opt/Qt5.7.0/5.7/gcc_64/plugins/sqldrivers$ ldd libqsqlmysql.so
                        i got this
                        itas02@itas02:/opt/Qt5.7.0/5.7/gcc_64/plugins/sqldrivers$ ldd libqsqlmysql.so
                        linux-vdso.so.1 => (0x00007fff17fa3000)
                        libmysqlclient_r.so.16 => not found
                        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f379c377000)
                        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f379c13e000)
                        how to get libmysqlclient_r.so ?

                        when i try to build qmake
                        by
                        $:/src/plugins/sqldrivers/mysql# /home/../Qt5.7/5.7/gcc_64/bin/qmake “INCLUDEPATH+=/usr/include/mysql” “LIBS+=-L/usr/lib/mysql” mysql.pro
                        after entering make command

                        i'm getting like this

                        g++ -c -pipe -O2 -std=gnu++11 -fvisibility=hidden -fvisibility-inlines-hidden -D_REENTRANT -Wall -W -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/opt/Qt5.7.0/5.7/gcc_64/include -I/opt/Qt5.7.0/5.7/gcc_64/include/QtSql -I/opt/Qt5.7.0/5.7/gcc_64/include/QtCore -I. -I/opt/Qt5.7.0/5.7/gcc_64/mkspecs/linux-g++ -o main.o main.cpp
                        In file included from main.cpp:44:0:
                        ../../../sql/drivers/mysql/qsql_mysql.h:52:19: fatal error: mysql.h: No such file or directory
                        #include <mysql.h>
                        ^
                        compilation terminated.
                        make: *** [main.o] Error 1

                        i have a mysql.h in /usr/include/mysql/

                        please let me know where i'm doing mistake are i missing any step.
                        thanks in advance

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #59

                          How did you install the MySQL development package ?

                          And why are you using two different version of Qt ? You are inspecting one in /opt/ and you seem to be calling qmake from another install of Qt in your home folder.

                          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
                          • chawilaC Offline
                            chawilaC Offline
                            chawila
                            wrote on last edited by
                            #60

                            Can someone help me here please...

                            i ran

                            qmake "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro
                            

                            And i got these error:

                            qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
                            
                            

                            What should i do?..

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #61

                              Please don't highjack other people thread.

                              You are already getting answers on your other thread here.

                              And you should use the complete path to the qmake of the version of Qt you are trying to build the plugin for. Without the path, you are calling your distribution installed qmake. Furthermore this one is for Qt 4.

                              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

                              • Login

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