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. mysql connection error
Forum Updated to NodeBB v4.3 + New Features

mysql connection error

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 869 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on 5 Nov 2018, 22:14 last edited by
    #1

    i have searched alot on the web for solving but with no luck

    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7

    db = QSqlDatabase::addDatabase("QMYSQL");
    db.setHostName("127.0.0.1");
    db.setPort(3306);
    db.setUserName("root");
    db.setPassword("123456");
    db.setDatabaseName("test");
    qDebug() << db.open();
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 5 Nov 2018, 22:20 last edited by
      #2

      Hi,

      This question has been asked many times already on this forum with always the same starting point:

      What version of Qt are you using ?
      On what platform ?
      What version of MySQL ?
      Did you install the MySQL client libraries ?

      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
      • ? Offline
        ? Offline
        A Former User
        wrote on 5 Nov 2018, 22:24 last edited by A Former User 11 May 2018, 22:38
        #3

        @SGaist
        EDITED

        1. qt 5.11.0
        2. windows
        3. 8.0.13
        4. yes i have

        i managed load it using mysql c connector lib
        but when i deploy the project it doesn't connect

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 5 Nov 2018, 22:27 last edited by
          #4

          Do you have the MySQL dlls findable by 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

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on 5 Nov 2018, 22:38 last edited by
            #5

            @SGaist
            i don't know

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 5 Nov 2018, 22:40 last edited by
              #6

              Then go to the Run part of the Project panel and add the QT_DEBUG_PLUGINS environment variable. Set it to 1 and look at your application for more information about 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

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on 5 Nov 2018, 23:22 last edited by
                #7

                @SGaist
                thats the output

                QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms" ...
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qminimal.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qminimal.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                   "MetaData": {
                       "Keys": [
                           "minimal"
                       ]
                   },
                   "className": "QMinimalIntegrationPlugin",
                   "debug": false,
                   "version": 330496
                }
                
                
                "The plugin 'C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qminimal.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
                        not a plugin
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qminimald.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qminimald.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                   "MetaData": {
                       "Keys": [
                           "minimal"
                       ]
                   },
                   "className": "QMinimalIntegrationPlugin",
                   "debug": true,
                   "version": 330496
                }
                
                
                Got keys from plugin meta data ("minimal")
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qoffscreen.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qoffscreen.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                   "MetaData": {
                       "Keys": [
                           "offscreen"
                       ]
                   },
                   "className": "QOffscreenIntegrationPlugin",
                   "debug": false,
                   "version": 330496
                }
                
                
                "The plugin 'C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qoffscreen.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
                        not a plugin
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qoffscreend.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qoffscreend.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                   "MetaData": {
                       "Keys": [
                           "offscreen"
                       ]
                   },
                   "className": "QOffscreenIntegrationPlugin",
                   "debug": true,
                   "version": 330496
                }
                
                
                Got keys from plugin meta data ("offscreen")
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qwindows.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qwindows.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                   "MetaData": {
                       "Keys": [
                           "windows"
                       ]
                   },
                   "className": "QWindowsIntegrationPlugin",
                   "debug": false,
                   "version": 330496
                }
                
                
                "The plugin 'C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qwindows.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
                        not a plugin
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qwindowsd.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qwindowsd.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                   "MetaData": {
                       "Keys": [
                           "windows"
                       ]
                   },
                   "className": "QWindowsIntegrationPlugin",
                   "debug": true,
                   "version": 330496
                }
                
                
                Got keys from plugin meta data ("windows")
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/David/Documents/build-untitled-Desktop_Qt_5_11_0_MinGW_32bit-Debug/debug/platforms" ...
                loaded library "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qwindowsd.dll"
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platformthemes" ...
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platformthemes/qflatpak.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platformthemes/qflatpak.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
                   "MetaData": {
                       "Keys": [
                           "flatpak"
                       ]
                   },
                   "className": "QFlatpakThemePlugin",
                   "debug": false,
                   "version": 330496
                }
                
                
                "The plugin 'C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platformthemes/qflatpak.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
                        not a plugin
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platformthemes/qflatpakd.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platformthemes/qflatpakd.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
                   "MetaData": {
                       "Keys": [
                           "flatpak"
                       ]
                   },
                   "className": "QFlatpakThemePlugin",
                   "debug": true,
                   "version": 330496
                }
                
                
                Got keys from plugin meta data ("flatpak")
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/David/Documents/build-untitled-Desktop_Qt_5_11_0_MinGW_32bit-Debug/debug/platformthemes" ...
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/styles" ...
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/styles/qwindowsvistastyle.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/styles/qwindowsvistastyle.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QStyleFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "windowsvista"
                       ]
                   },
                   "className": "QWindowsVistaStylePlugin",
                   "debug": false,
                   "version": 330496
                }
                
                
                "The plugin 'C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/styles/qwindowsvistastyle.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
                        not a plugin
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/styles/qwindowsvistastyled.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/styles/qwindowsvistastyled.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QStyleFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "windowsvista"
                       ]
                   },
                   "className": "QWindowsVistaStylePlugin",
                   "debug": true,
                   "version": 330496
                }
                
                
                Got keys from plugin meta data ("windowsvista")
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/David/Documents/build-untitled-Desktop_Qt_5_11_0_MinGW_32bit-Debug/debug/styles" ...
                loaded library "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/styles/qwindowsvistastyled.dll"
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/iconengines" ...
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/iconengines/qsvgicon.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/iconengines/qsvgicon.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QIconEngineFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "svg",
                           "svgz",
                           "svg.gz"
                       ]
                   },
                   "className": "QSvgIconPlugin",
                   "debug": false,
                   "version": 330496
                }
                
                
                "The plugin 'C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/iconengines/qsvgicon.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
                        not a plugin
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/iconengines/qsvgicond.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/iconengines/qsvgicond.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QIconEngineFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "svg",
                           "svgz",
                           "svg.gz"
                       ]
                   },
                   "className": "QSvgIconPlugin",
                   "debug": true,
                   "version": 330496
                }
                
                
                Got keys from plugin meta data ("svg", "svgz", "svg.gz")
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/David/Documents/build-untitled-Desktop_Qt_5_11_0_MinGW_32bit-Debug/debug/iconengines" ...
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers" ...
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlite.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlite.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "QSQLITE"
                       ]
                   },
                   "className": "QSQLiteDriverPlugin",
                   "debug": false,
                   "version": 330496
                }
                
                
                "The plugin 'C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlite.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
                        not a plugin
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlited.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlited.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "QSQLITE"
                       ]
                   },
                   "className": "QSQLiteDriverPlugin",
                   "debug": true,
                   "version": 330496
                }
                
                
                Got keys from plugin meta data ("QSQLITE")
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlmysql.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlmysql.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "QMYSQL3",
                           "QMYSQL"
                       ]
                   },
                   "className": "QMYSQLDriverPlugin",
                   "debug": false,
                   "version": 330496
                }
                
                
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlmysqld.dll"
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlmysqld.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlmysqld.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "QMYSQL3",
                           "QMYSQL"
                       ]
                   },
                   "className": "QMYSQLDriverPlugin",
                   "debug": true,
                   "version": 330496
                }
                
                
                Got keys from plugin meta data ("QMYSQL3", "QMYSQL")
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlodbc.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlodbc.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "QODBC3",
                           "QODBC"
                       ]
                   },
                   "className": "QODBCDriverPlugin",
                   "debug": false,
                   "version": 330496
                }
                
                
                "The plugin 'C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlodbc.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
                        not a plugin
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlodbcd.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlodbcd.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "QODBC3",
                           "QODBC"
                       ]
                   },
                   "className": "QODBCDriverPlugin",
                   "debug": true,
                   "version": 330496
                }
                
                
                Got keys from plugin meta data ("QODBC3", "QODBC")
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlpsql.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlpsql.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "QPSQL7",
                           "QPSQL"
                       ]
                   },
                   "className": "QPSQLDriverPlugin",
                   "debug": false,
                   "version": 330496
                }
                
                
                "The plugin 'C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlpsql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
                        not a plugin
                QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlpsqld.dll"
                Found metadata in lib C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlpsqld.dll, metadata=
                {
                   "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                   "MetaData": {
                       "Keys": [
                           "QPSQL7",
                           "QPSQL"
                       ]
                   },
                   "className": "QPSQLDriverPlugin",
                   "debug": true,
                   "version": 330496
                }
                
                
                Got keys from plugin meta data ("QPSQL7", "QPSQL")
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/David/Documents/build-untitled-Desktop_Qt_5_11_0_MinGW_32bit-Debug/debug/sqldrivers" ...
                loaded library "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlmysqld.dll"
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/accessible" ...
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/David/Documents/build-untitled-Desktop_Qt_5_11_0_MinGW_32bit-Debug/debug/accessible" ...
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/accessiblebridge" ...
                QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/David/Documents/build-untitled-Desktop_Qt_5_11_0_MinGW_32bit-Debug/debug/accessiblebridge" ...
                QLibraryPrivate::unload succeeded on "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/styles/qwindowsvistastyled.dll" 
                QLibraryPrivate::unload succeeded on "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/platforms/qwindowsd.dll" 
                QLibraryPrivate::unload succeeded on "C:/Qt/Qt5.11.0/5.11.0/mingw53_32/plugins/sqldrivers/qsqlmysqld.dll
                ```"
                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 6 Nov 2018, 22:57 last edited by
                  #8

                  Since you marked the thread solved, what did you do to fix the situation ?

                  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/8

                  5 Nov 2018, 22:14

                  • Login

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