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 (but built)
Qt 6.11 is out! See what's new in the release blog

QMYSQL driver not loaded (but built)

Scheduled Pinned Locked Moved Installation and Deployment
9 Posts 4 Posters 7.8k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    Audiocrow
    wrote on last edited by
    #1

    I followed this guide (http://www.seppemagiels.com/blog/create-mysql-driver-qt-windows) and built the dlls and .a files. I put them in the spot the guide said (.../qtsources/4.8.1/src/plugins/sqldrivers), my mingw/bin folder, and also my qtsdk/desktop/qt/4.8.1/mingw/bin folder. However, when I run his test application, the only results I'm getting from QSqlDatabase::drivers() are "QSQLITE", "QODBC3", and "QODBC". I'm supposed to be getting a result for QMYSQL. What do I need to do? I tried adding INCLUDEPATH and LIBS in my project.pro file to point to any folder that had the dlls I made, but that didn't change anything.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Set the following environment variable, and run again. Then, post the debug output.
      @
      QT_DEBUG_PLUGINS = 1
      @

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bkerdev
        wrote on last edited by
        #3

        I have the same problem, I'm compiling the dylib and are already in the right repectoire. But when I compile I get the message Error
        QMYSQL driver not loaded
        QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7
        QSqlError(-1, "Driver not loaded", "Driver not loaded")

        I'm using Qt 5.0.2 and Qt Creator 2.7.1 for Mac OS X 10.7.5
        Thanks you

        Boris Bker

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bkerdev
          wrote on last edited by
          #4

          I'm use
          [quote author="Andre" date="1351773160"]Set the following environment variable, and run again. Then, post the debug output.
          @
          QT_DEBUG_PLUGINS = 1
          @[/quote]

          And i show this error

          QFactoryLoader::QFactoryLoader() looking at "/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/platforms/libqcocoa.dylib"
          Got keys from plugin meta data ("cocoa")
          QFactoryLoader::QFactoryLoader() looking at "/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/platforms/libqminimal.dylib"
          Got keys from plugin meta data ("minimal")
          QFactoryLoader::QFactoryLoader() looking at "/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/platforms/libqminimal_debug.dylib"
          Got keys from plugin meta data ("minimal")
          loaded library "/System/Library/Frameworks/Carbon.framework/Carbon"
          QFactoryLoader::QFactoryLoader() looking at "/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlite.dylib"
          Got keys from plugin meta data ("QSQLITE")
          QFactoryLoader::QFactoryLoader() looking at "/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlite_debug.dylib"
          Got keys from plugin meta data ("QSQLITE")
          QFactoryLoader::QFactoryLoader() looking at "/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlmysql.dylib"
          "Cannot load library /Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlmysql.dylib: (dlopen(/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlmysql.dylib, 5): Library not loaded: libmysqlclient.18.dylib
          Referenced from: /Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlmysql.dylib
          Reason: image not found)"
          not a plugin
          QFactoryLoader::QFactoryLoader() looking at "/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlmysql_debug.dylib"
          "Cannot load library /Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlmysql_debug.dylib: (dlopen(/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlmysql_debug.dylib, 5): Library not loaded: libmysqlclient.18.dylib
          Referenced from: /Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlmysql_debug.dylib
          Reason: image not found)"
          not a plugin
          QFactoryLoader::QFactoryLoader() looking at "/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlodbc.dylib"
          Got keys from plugin meta data ("QODBC3", "QODBC")
          QFactoryLoader::QFactoryLoader() looking at "/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlodbc_debug.dylib"
          Got keys from plugin meta data ("QODBC3", "QODBC")
          QFactoryLoader::QFactoryLoader() looking at "/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlpsql.dylib"
          Got keys from plugin meta data ("QPSQL7", "QPSQL")
          QFactoryLoader::QFactoryLoader() looking at "/Developer/Qt/Qt5.0.2/5.0.2/clang_64/plugins/sqldrivers/libqsqlpsql_debug.dylib"
          Got keys from plugin meta data ("QPSQL7", "QPSQL")
          QSqlDatabase: QMYSQL driver not loaded
          QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7
          QSqlError(-1, "Driver not loaded", "Driver not loaded")

          Boris Bker

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

            Hi,

            The loader can't find libmysqlclient. Do you have it in your PATH ?

            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
            • B Offline
              B Offline
              bkerdev
              wrote on last edited by
              #6

              Hi,
              yes, i have.
              It is in the installation folder of MySQL

              Boris Bker

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

                Let me rephrase that:

                In your PATH environment variable, do you have the path pointing to the folder where libmysqlclient.dylib can be 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
                • B Offline
                  B Offline
                  bkerdev
                  wrote on last edited by
                  #8

                  No, how can do?

                  Boris Bker

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

                    Two possibilities:
                    Update you .profile and start QtCreator from the console using :
                    @open myproject.pro@

                    Updated the value in the Run section of the Project panel

                    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