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

Error QMYSQL Plugin on Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
59 Posts 8 Posters 19.9k 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 Offline
    S Offline
    Stelian
    wrote on last edited by
    #26

    When I've run a simple program

    #include <QCoreApplication>
    #include <QtSql>
    #include <QSqlDatabase>
    #include <QtDebug>
    
    int main(int argc, char *argv[])
    {
        QCoreApplication a(argc, argv);
    
        QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
        db.setHostName("localhost");
        db.setUserName("root");
        db.setPassword("DSa81&l12&z26");
        db.setDatabaseName("Employee_management");
    
        if (db.open())
        {
            qDebug() << "Database connected successfuly!";
        }
        else
        {
            qDebug() << "Database is not connected!";
        }
    
        return a.exec();
    }
    

    I receive the message "Database is not connected!", which means there are still some blurring about the QMYSQL driver.

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

      Did you call mingw32-make install after the build succeeded ?

      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
      1
      • S Offline
        S Offline
        Stelian
        wrote on last edited by Stelian
        #28

        Yes, and I received the next message

        cd odbc\ && ( if not exist Makefile C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake.exe -o Makefile C:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers\odbc\odbc.pro ) && mingw32-make -f Makefile install
        mingw32-make[1]: Entering directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/odbc'
        mingw32-make -f Makefile.Release install
        mingw32-make[2]: Entering directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/odbc'
        copy /y ..\plugins\sqldrivers\qsqlodbc.dll C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlodbc.dll
                1 file(s) copied.
        C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake.exe -install qinstall C:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers\lib\cmake\Qt5Sql\Qt5Sql_QODBCDriverPlugin.cmake C:\Qt\Qt5.12.1\5.12.1\mingw73_64\lib\cmake\Qt5Sql\Qt5Sql_QODBCDriverPlugin.cmake
        mingw32-make[2]: Leaving directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/odbc'
        mingw32-make -f Makefile.Debug install
        mingw32-make[2]: Entering directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/odbc'
        copy /y ..\plugins\sqldrivers\qsqlodbcd.dll C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlodbcd.dll
                1 file(s) copied.
        C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake.exe -install qinstall C:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers\lib\cmake\Qt5Sql\Qt5Sql_QODBCDriverPlugin.cmake C:\Qt\Qt5.12.1\5.12.1\mingw73_64\lib\cmake\Qt5Sql\Qt5Sql_QODBCDriverPlugin.cmake
        mingw32-make[2]: Leaving directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/odbc'
        mingw32-make[1]: Leaving directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/odbc'
        cd sqlite\ && ( if not exist Makefile C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake.exe -o Makefile C:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers\sqlite\sqlite.pro ) && mingw32-make -f Makefile install
        mingw32-make[1]: Entering directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/sqlite'
        mingw32-make -f Makefile.Release install
        mingw32-make[2]: Entering directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/sqlite'
        copy /y ..\plugins\sqldrivers\qsqlite.dll C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlite.dll
                1 file(s) copied.
        C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake.exe -install qinstall C:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers\lib\cmake\Qt5Sql\Qt5Sql_QSQLiteDriverPlugin.cmake C:\Qt\Qt5.12.1\5.12.1\mingw73_64\lib\cmake\Qt5Sql\Qt5Sql_QSQLiteDriverPlugin.cmake
        mingw32-make[2]: Leaving directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/sqlite'
        mingw32-make -f Makefile.Debug install
        mingw32-make[2]: Entering directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/sqlite'
        copy /y ..\plugins\sqldrivers\qsqlited.dll C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlited.dll
                1 file(s) copied.
        C:\Qt\Qt5.12.1\5.12.1\mingw73_64\bin\qmake.exe -install qinstall C:\Qt\Qt5.12.1\Sources\qtbase\src\plugins\sqldrivers\lib\cmake\Qt5Sql\Qt5Sql_QSQLiteDriverPlugin.cmake C:\Qt\Qt5.12.1\5.12.1\mingw73_64\lib\cmake\Qt5Sql\Qt5Sql_QSQLiteDriverPlugin.cmake
        mingw32-make[2]: Leaving directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/sqlite'
        mingw32-make[1]: Leaving directory 'c:/Qt/Qt5.12.1/Sources/qtbase/src/plugins/sqldrivers/sqlite'
        

        Part of this message is in my previous post

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Stelian
          wrote on last edited by Stelian
          #29

          When I run the code

          QSqlDatabase: QMYSQL driver not loaded
          QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
          Database is Not Connected!
          
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #30

            In Qt Creator's Run part of the Project panel, did you add the path to the MySQL dlls in the PATH environment variable ?

            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

              In Qt Creator's Run part of the Project panel, did you add the path to the MySQL dlls in the PATH environment variable ?

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

              @SGaist Let me understand.
              First of all, do you mean I have to add that path "C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib" or this path "C:\Program Files\MySQL\MySQL Server 8.0\lib"
              Second of all, where do I have to add ? (see picture1 and picture2) ?0_1551348026672_Picture1.jpg
              0_1551348044412_Picture2.jpg

              jsulmJ 1 Reply Last reply
              0
              • S Stelian

                @SGaist Let me understand.
                First of all, do you mean I have to add that path "C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib" or this path "C:\Program Files\MySQL\MySQL Server 8.0\lib"
                Second of all, where do I have to add ? (see picture1 and picture2) ?0_1551348026672_Picture1.jpg
                0_1551348044412_Picture2.jpg

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #32

                @Stelian As @SGaist wrote: in QtCreator Run settings.
                I think you need the MySQL connector libs (but you can simply put both).

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                S 1 Reply Last reply
                1
                • jsulmJ jsulm

                  @Stelian As @SGaist wrote: in QtCreator Run settings.
                  I think you need the MySQL connector libs (but you can simply put both).

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

                  @jsulm Where do I have to add in the first picture or second ?

                  jsulmJ 1 Reply Last reply
                  0
                  • S Stelian

                    @jsulm Where do I have to add in the first picture or second ?

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #34

                    @Stelian In the second of course as it is showing exactly what was suggested: Run settings in QtCreator.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    S 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @Stelian In the second of course as it is showing exactly what was suggested: Run settings in QtCreator.

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

                      @jsulm I,ve added both C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib" and this path "C:\Program Files\MySQL\MySQL Server 8.0\lib in Run Settings -> Run Environment -> Path, then restart Qt and run the code, Not connected.

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

                        Then again, start your application with the QT_DEBUG_PLUGINS environment variable to see what is happening.

                        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

                          Then again, start your application with the QT_DEBUG_PLUGINS environment variable to see what is happening.

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

                          @SGaist

                          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!
                          
                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #38

                            Looks like you only built the plugin for release and not for debug and you are running a debug build of your application.

                            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
                            2
                            • SGaistS SGaist

                              Looks like you only built the plugin for release and not for debug and you are running a debug build of your application.

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

                              @SGaist I do not know if I built the plugin for release and not for debug, but if you say that I did, ok, you are the champion.
                              Tell me what I have to do next.

                              1 Reply Last reply
                              0
                              • SGaistS SGaist

                                Looks like you only built the plugin for release and not for debug and you are running a debug build of your application.

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

                                @SGaist Believe me, I don't know how to build a plugin in release mode or in debug mode, to my shame.
                                If I did that, I did it unconsciously.

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

                                  Add -debug to the qmake call

                                  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

                                    Add -debug to the qmake call

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

                                    @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 1 Reply Last reply
                                    0
                                    • 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

                                          • Login

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