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. Error QMYSQL Plugin on Windows
Forum Updated to NodeBB v4.3 + New Features

Error QMYSQL Plugin on Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
59 Posts 8 Posters 17.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.
  • S Stelian

    @SGaist I've called the qmake in debug mode, run the code and again Database is Not Connected!
    Then again, I have start the application with the QT_DEBUG_PLUGINS environment variable and I get the next message

    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlite.dll"
    Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlite.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QSQLITE"
            ]
        },
        "archreq": 0,
        "className": "QSQLiteDriverPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlite.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlited.dll"
    Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlited.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QSQLITE"
            ]
        },
        "archreq": 1,
        "className": "QSQLiteDriverPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("QSQLITE")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll"
    Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QMYSQL3",
                "QMYSQL"
            ]
        },
        "archreq": 0,
        "className": "QMYSQLDriverPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll"
    Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QMYSQL3",
                "QMYSQL"
            ]
        },
        "archreq": 1,
        "className": "QMYSQLDriverPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("QMYSQL3", "QMYSQL")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbc.dll"
    Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbc.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QODBC3",
                "QODBC"
            ]
        },
        "archreq": 0,
        "className": "QODBCDriverPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbc.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbcd.dll"
    Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbcd.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QODBC3",
                "QODBC"
            ]
        },
        "archreq": 1,
        "className": "QODBCDriverPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("QODBC3", "QODBC")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsql.dll"
    Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsql.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QPSQL7",
                "QPSQL"
            ]
        },
        "archreq": 0,
        "className": "QPSQLDriverPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsqld.dll"
    Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsqld.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QPSQL7",
                "QPSQL"
            ]
        },
        "archreq": 1,
        "className": "QPSQLDriverPlugin",
        "debug": true,
        "version": 330752
    }
    
    Got keys from plugin meta data ("QPSQL7", "QPSQL")
    QFactoryLoader::QFactoryLoader() checking directory path "E:/Qt Creator/build-sql_console_test-Desktop_Qt_5_12_1_MinGW_64_bit-Debug/debug/sqldrivers" ...
    Cannot load library C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found.
    QLibraryPrivate::loadPlugin failed on "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll" : "Cannot load library C:\\Qt\\Qt5.12.1\\5.12.1\\mingw73_64\\plugins\\sqldrivers\\qsqlmysqld.dll: The specified module could not be found."
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
    Database is Not Connected!
    
    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by JonB
    #43

    @Stelian

    Cannot load library C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found.

    Does the exact file specified by that path actually exist, or not? (Note that the file mentioned, qsqlmysqld.dll, has a d just before the ., presumably indicating it's a debug build; this is not the same as if it were qsqlmysql.dll.)

    S 1 Reply Last reply
    1
    • JonBJ JonB

      @Stelian

      Cannot load library C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found.

      Does the exact file specified by that path actually exist, or not? (Note that the file mentioned, qsqlmysqld.dll, has a d just before the ., presumably indicating it's a debug build; this is not the same as if it were qsqlmysql.dll.)

      S Offline
      S Offline
      Stelian
      wrote on last edited by
      #44

      @JonB Thank you for reply!
      I apologize for answering late, but that file is right in that location:

      C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlmysqld.dll
      

      See the print 0_1551538547607_Annotation 2019-03-02 165509.jpg screen.

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

        To reduce the output, can you move out of that folder all .dll files that are not related to MySQL ?

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

        S 1 Reply Last reply
        0
        • SGaistS SGaist

          To reduce the output, can you move out of that folder all .dll files that are not related to MySQL ?

          S Offline
          S Offline
          Stelian
          wrote on last edited by
          #46

          @SGaist I removed the non-MySQL files
          Here is the output

          QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers" ...
          QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll"
          Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll, metadata=
          {
              "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
              "MetaData": {
                  "Keys": [
                      "QMYSQL3",
                      "QMYSQL"
                  ]
              },
              "archreq": 0,
              "className": "QMYSQLDriverPlugin",
              "debug": false,
              "version": 330752
          }
          
          
          "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
                   not a plugin
          QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll"
          Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll, metadata=
          {
              "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
              "MetaData": {
                  "Keys": [
                      "QMYSQL3",
                      "QMYSQL"
                  ]
              },
              "archreq": 1,
              "className": "QMYSQLDriverPlugin",
              "debug": true,
              "version": 330752
          }
          
          
          Got keys from plugin meta data ("QMYSQL3", "QMYSQL")
          QFactoryLoader::QFactoryLoader() checking directory path "E:/Qt Creator/build-sql_console_test-Desktop_Qt_5_12_1_MinGW_64_bit-Debug/debug/sqldrivers" ...
          Cannot load library C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found.
          QLibraryPrivate::loadPlugin failed on "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll" : "Cannot load library C:\\Qt\\Qt5.12.1\\5.12.1\\mingw73_64\\plugins\\sqldrivers\\qsqlmysqld.dll: The specified module could not be found."
          QSqlDatabase: QMYSQL driver not loaded
          QSqlDatabase: available drivers: QMYSQL QMYSQL3
          Database is Not Connected!
          

          Same file qsqlmysqld.dll

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

            Where exactly are the dlls matching the library you used to build the plugin ?

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

            S 2 Replies Last reply
            0
            • SGaistS SGaist

              Where exactly are the dlls matching the library you used to build the plugin ?

              S Offline
              S Offline
              Stelian
              wrote on last edited by
              #48

              @SGaist The dlls I've used are C:Program Files/MYSQL/MySQL Server 8.0/lib

              0_1551558942027_Annotation 2019-03-02 223046.jpg

              If you talk about other dlls please correct me

              1 Reply Last reply
              0
              • SGaistS SGaist

                Where exactly are the dlls matching the library you used to build the plugin ?

                S Offline
                S Offline
                Stelian
                wrote on last edited by
                #49

                @SGaist I would have to use dlls from this path C:Program Files (x86)/MySQL/MySQL Connector C 6.1/lib

                0_1551561982860_Annotation 2019-03-02 232603.jpg

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

                  @Stelian said in Error QMYSQL Plugin on Windows:

                  C:Program Files/MYSQL/MySQL Server 8.0/lib

                  Then that's the one you should be having in your PATH environment variable.

                  One other thing you can use is Dependency Walker. Use it on your Qt MySQL plugin. Check that it can find the MySQL dll.

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

                  S 1 Reply Last reply
                  1
                  • SGaistS SGaist

                    @Stelian said in Error QMYSQL Plugin on Windows:

                    C:Program Files/MYSQL/MySQL Server 8.0/lib

                    Then that's the one you should be having in your PATH environment variable.

                    One other thing you can use is Dependency Walker. Use it on your Qt MySQL plugin. Check that it can find the MySQL dll.

                    S Offline
                    S Offline
                    Stelian
                    wrote on last edited by Stelian
                    #51

                    @SGaist yes, I have that path in my path environment variable.
                    I have never used Dependency Walker.
                    What do I have to do ?

                    JonBJ 1 Reply Last reply
                    0
                    • S Stelian

                      @SGaist yes, I have that path in my path environment variable.
                      I have never used Dependency Walker.
                      What do I have to do ?

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on last edited by
                      #52

                      @Stelian
                      Go to http://www.dependencywalker.com/, read, and download the appropriate for your architecture. You just point it at a .exe, or in this case the .dll you are having trouble with. Look through its output window, to see whether there is another .dll which is required but cannot be found, and report back.

                      1 Reply Last reply
                      2
                      • S Offline
                        S Offline
                        Stelian
                        wrote on last edited by
                        #53

                        0_1551713007838_Annotation 2019-03-03 231800.jpg

                        0_1551713024334_Annotation 2019-03-03 231830.jpg

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

                          If you close the yellow branches does the MySQL dll appear as good or not ?

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

                          S 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            If you close the yellow branches does the MySQL dll appear as good or not ?

                            S Offline
                            S Offline
                            Stelian
                            wrote on last edited by
                            #55

                            @SGaist I don't have an option to close the yellow branches
                            0_1551723782285_Annotation 2019-03-04 202230.jpg

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

                              I meant: close the branches where all these warnings can be seen. Just take care to verify that you're not hiding a bigger issue while doing that.

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

                              H 1 Reply Last reply
                              0
                              • SGaistS SGaist

                                I meant: close the branches where all these warnings can be seen. Just take care to verify that you're not hiding a bigger issue while doing that.

                                H Offline
                                H Offline
                                Hitek
                                wrote on last edited by
                                #57

                                @SGaist i got the same issue.
                                This is my dependency walker screen. LIBMYSQL.DLL looks good but i dont know why i still got this error "QSqlDatabase: QMYSQL driver not loaded".Capture.PNG image url)

                                aha_1980A 1 Reply Last reply
                                0
                                • H Hitek

                                  @SGaist i got the same issue.
                                  This is my dependency walker screen. LIBMYSQL.DLL looks good but i dont know why i still got this error "QSqlDatabase: QMYSQL driver not loaded".Capture.PNG image url)

                                  aha_1980A Offline
                                  aha_1980A Offline
                                  aha_1980
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #58

                                  Hi @Hitek,

                                  This libmysql.dll is a 64 bit library. Are you using a 64 bit or 32 bit Qt version for your program?

                                  Regards

                                  Qt has to stay free or it will die.

                                  1 Reply Last reply
                                  1
                                  • Christian EhrlicherC Offline
                                    Christian EhrlicherC Offline
                                    Christian Ehrlicher
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #59

                                    And is the library in the correct folder?

                                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                    Visit the Qt Academy at https://academy.qt.io/catalog

                                    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