Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QSqlDatabase: QMYSQL driver not loaded
Forum Updated to NodeBB v4.3 + New Features

QSqlDatabase: QMYSQL driver not loaded

Scheduled Pinned Locked Moved Unsolved Qt 6
33 Posts 5 Posters 7.5k Views 2 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.
  • SGaistS SGaist

    As I suggested, did you install the plugin ?

    A Offline
    A Offline
    AlexFr
    wrote on last edited by
    #15

    @SGaist the errors I am getting

    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL")
    qt.core.plugin.factoryloader: checking directory path "C:/Users/user/Documents/CP/build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Debug/debug/sqldrivers" ...
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC QPSQL
    No Connection

    qt.core.plugin.factoryloader: checking directory path "C:/Qt/6.4.0/msvc2019_64/plugins/accessiblebridge" ...
    qt.core.plugin.factoryloader: checking directory path "C:/Users/user/Documents/CP/build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Debug/debug/accessiblebridge" ...

    any help would be greatly appreciated.

    JonBJ 1 Reply Last reply
    0
    • A AlexFr

      @SGaist the errors I am getting

      qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL")
      qt.core.plugin.factoryloader: checking directory path "C:/Users/user/Documents/CP/build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Debug/debug/sqldrivers" ...
      QSqlDatabase: QMYSQL driver not loaded
      QSqlDatabase: available drivers: QSQLITE QODBC QPSQL
      No Connection

      qt.core.plugin.factoryloader: checking directory path "C:/Qt/6.4.0/msvc2019_64/plugins/accessiblebridge" ...
      qt.core.plugin.factoryloader: checking directory path "C:/Users/user/Documents/CP/build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Debug/debug/accessiblebridge" ...

      any help would be greatly appreciated.

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

      @AlexFr said in QSqlDatabase: QMYSQL driver not loaded:

      QSqlDatabase: QMYSQL driver not loaded
      QSqlDatabase: available drivers: QSQLITE QODBC QPSQL

      Your output show no sign/mention of finding any QMYSQL plugin anywhere (where it is looking). So what file(s) do you have where for plugins with regard to QMYSQL? It looks like either there is nothing at all, so it cannot even try to load it, or there is some output earlier in the diagnostic relating to QMYSQL which you are not showing.

      A 1 Reply Last reply
      0
      • JonBJ JonB

        @AlexFr said in QSqlDatabase: QMYSQL driver not loaded:

        QSqlDatabase: QMYSQL driver not loaded
        QSqlDatabase: available drivers: QSQLITE QODBC QPSQL

        Your output show no sign/mention of finding any QMYSQL plugin anywhere (where it is looking). So what file(s) do you have where for plugins with regard to QMYSQL? It looks like either there is nothing at all, so it cannot even try to load it, or there is some output earlier in the diagnostic relating to QMYSQL which you are not showing.

        A Offline
        A Offline
        AlexFr
        wrote on last edited by
        #17

        @JonB in this folder "C:\Qt\6.4.0\mingw_64\plugins\sqldrivers", I have "qsqlmysql.dll" and "qsqlmysql.debug", amongst other files. I built the plugin using:
        "
        mkdir build-sqldrivers
        cd build-sqldrivers

        qt-cmake -G Ninja <qt_installation_path>\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=<qt_installation_path><platform> -DMySQL_INCLUDE_DIR="C:\mysql-8.0.22-winx64\include" -DMySQL_LIBRARY="C:\mysql-8.0.22-winx64\lib\libmysql.lib"
        cmake --build .
        cmake --install .
        "

        1 Reply Last reply
        0
        • hskoglundH hskoglund

          Hi, please be careful with your versions of Qt:

          1. you use Qt 5.15.2 for the debug build
            (C:/Users/Nelson/Documents/CP/build-DatabaseConn-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug/debug/)
          2. 'C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/ as the place where Qt looks for the MySQL plugin
          3. C:\Qt\6.0.0\Src\qtbase\src\plugins\sqldrivers is where you build it from (and installing to C:\Qt\6.0.0\mingw81_64)

          Don't know if that's the cause of the problems but it will help to only use one version of Qt for everything :-)

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

          @hskoglund said in QSqlDatabase: QMYSQL driver not loaded:

          'C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/ as the place where Qt looks for the MySQL plugin
          C:\Qt\6.0.0\Src\qtbase\src\plugins\sqldrivers is where you build it from (and installing to C:\Qt\6.0.0\mingw81_64)

          @AlexFr said in QSqlDatabase: QMYSQL driver not loaded:

          @JonB in this folder "C:\Qt\6.4.0\mingw_64\plugins\sqldrivers", I have "qsqlmysql.dll" and "qsqlmysql.debug"

          Seems to me you have a mix-up/mismatch betwenn these paths, not to mention whether you are using MinGW versus MSVC. Sort out what you are using from where, for sure. That is all I know.

          A 1 Reply Last reply
          0
          • JonBJ JonB

            @hskoglund said in QSqlDatabase: QMYSQL driver not loaded:

            'C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/ as the place where Qt looks for the MySQL plugin
            C:\Qt\6.0.0\Src\qtbase\src\plugins\sqldrivers is where you build it from (and installing to C:\Qt\6.0.0\mingw81_64)

            @AlexFr said in QSqlDatabase: QMYSQL driver not loaded:

            @JonB in this folder "C:\Qt\6.4.0\mingw_64\plugins\sqldrivers", I have "qsqlmysql.dll" and "qsqlmysql.debug"

            Seems to me you have a mix-up/mismatch betwenn these paths, not to mention whether you are using MinGW versus MSVC. Sort out what you are using from where, for sure. That is all I know.

            A Offline
            A Offline
            AlexFr
            wrote on last edited by
            #19

            @JonB thanks for the reply. I also have I have "qsqlmysql.dll" and "qsqlmysql.debug" in "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/" and it still does not work.

            JonBJ 1 Reply Last reply
            0
            • A AlexFr

              @JonB thanks for the reply. I also have I have "qsqlmysql.dll" and "qsqlmysql.debug" in "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/" and it still does not work.

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

              @AlexFr
              It's no good just having the files in that directory, you have to have the application looking in that directory to find it/them. I do not not know whether that is happening in your situation.

              A 1 Reply Last reply
              0
              • JonBJ JonB

                @AlexFr
                It's no good just having the files in that directory, you have to have the application looking in that directory to find it/them. I do not not know whether that is happening in your situation.

                A Offline
                A Offline
                AlexFr
                wrote on last edited by
                #21

                @JonB thanks for the reply.
                this is part of the error message:
                "
                qt.core.plugin.factoryloader: checking directory path "C:/Qt/6.4.0/msvc2019_64/plugins/accessiblebridge"
                "

                1 Reply Last reply
                0
                • hskoglundH Offline
                  hskoglundH Offline
                  hskoglund
                  wrote on last edited by
                  #22

                  Hi, you can try building your app in Release mode (not Debug), perhaps the release mode version of the QMySQL plugin you built will be picked up better than the debug version.
                  Also please include all of the output from QT_DEBUG_PLUGINS, not just a single line...

                  A 1 Reply Last reply
                  0
                  • hskoglundH hskoglund

                    Hi, you can try building your app in Release mode (not Debug), perhaps the release mode version of the QMySQL plugin you built will be picked up better than the debug version.
                    Also please include all of the output from QT_DEBUG_PLUGINS, not just a single line...

                    A Offline
                    A Offline
                    AlexFr
                    wrote on last edited by
                    #23

                    @hskoglund Hi. Thanks for the answer. I tried that, still I get the same errors. I can post the errors of course.

                    qt.core.plugin.factoryloader: checking directory path "C:/Qt/6.4.0/msvc2019_64/plugins/platforms" ...
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qdirect2d.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qdirect2d.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                    "MetaData": {
                    "Keys": [
                    "direct2d"
                    ]
                    },
                    "archlevel": 1,
                    "className": "QWindowsDirect2DIntegrationPlugin",
                    "debug": false,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("direct2d")
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qdirect2dd.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qdirect2dd.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                    "MetaData": {
                    "Keys": [
                    "direct2d"
                    ]
                    },
                    "archlevel": 1,
                    "className": "QWindowsDirect2DIntegrationPlugin",
                    "debug": true,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qdirect2dd.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
                    not a plugin
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qminimal.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qminimal.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                    "MetaData": {
                    "Keys": [
                    "minimal"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QMinimalIntegrationPlugin",
                    "debug": false,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("minimal")
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qminimald.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qminimald.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                    "MetaData": {
                    "Keys": [
                    "minimal"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QMinimalIntegrationPlugin",
                    "debug": true,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qminimald.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
                    not a plugin
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qoffscreen.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qoffscreen.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                    "MetaData": {
                    "Keys": [
                    "offscreen"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QOffscreenIntegrationPlugin",
                    "debug": false,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("offscreen")
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qoffscreend.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qoffscreend.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                    "MetaData": {
                    "Keys": [
                    "offscreen"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QOffscreenIntegrationPlugin",
                    "debug": true,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qoffscreend.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
                    not a plugin
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qwindows.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qwindows.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                    "MetaData": {
                    "Keys": [
                    "windows"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QWindowsIntegrationPlugin",
                    "debug": false,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("windows")
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qwindowsd.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qwindowsd.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                    "MetaData": {
                    "Keys": [
                    "windows"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QWindowsIntegrationPlugin",
                    "debug": true,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qwindowsd.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
                    not a plugin
                    qt.core.plugin.factoryloader: checking directory path "C:/Users/user/Documents/CP/build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release/release/platforms" ...
                    qt.core.library: "C:/Qt/6.4.0/msvc2019_64/plugins/platforms/qwindows.dll" loaded library
                    qt.core.plugin.factoryloader: checking directory path "C:/Qt/6.4.0/msvc2019_64/plugins/platformthemes" ...
                    qt.core.plugin.factoryloader: checking directory path "C:/Users/user/Documents/CP/build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release/release/platformthemes" ...
                    qt.core.plugin.factoryloader: checking directory path "C:/Qt/6.4.0/msvc2019_64/plugins/styles" ...
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/styles/qwindowsvistastyle.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/styles/qwindowsvistastyle.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QStyleFactoryInterface",
                    "MetaData": {
                    "Keys": [
                    "windowsvista"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QWindowsVistaStylePlugin",
                    "debug": false,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("windowsvista")
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/styles/qwindowsvistastyled.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/styles/qwindowsvistastyled.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QStyleFactoryInterface",
                    "MetaData": {
                    "Keys": [
                    "windowsvista"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QWindowsVistaStylePlugin",
                    "debug": true,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.0/msvc2019_64/plugins/styles/qwindowsvistastyled.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
                    not a plugin
                    qt.core.plugin.factoryloader: checking directory path "C:/Users/user/Documents/CP/build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release/release/styles" ...
                    qt.core.library: "C:/Qt/6.4.0/msvc2019_64/plugins/styles/qwindowsvistastyle.dll" loaded library
                    qt.core.plugin.factoryloader: checking directory path "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers" ...
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlite.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlite.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                    "MetaData": {
                    "Keys": [
                    "QSQLITE"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QSQLiteDriverPlugin",
                    "debug": false,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QSQLITE")
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlited.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlited.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                    "MetaData": {
                    "Keys": [
                    "QSQLITE"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QSQLiteDriverPlugin",
                    "debug": true,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlited.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
                    not a plugin
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                    "MetaData": {
                    "Keys": [
                    "QMYSQL",
                    "QMARIADB"
                    ]
                    },
                    "archlevel": 2,
                    "className": "QMYSQLDriverPlugin",
                    "debug": false,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMYSQL", "QMARIADB")
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlodbc.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlodbc.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                    "MetaData": {
                    "Keys": [
                    "QODBC"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QODBCDriverPlugin",
                    "debug": false,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QODBC")
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlodbcd.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlodbcd.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                    "MetaData": {
                    "Keys": [
                    "QODBC"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QODBCDriverPlugin",
                    "debug": true,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlodbcd.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
                    not a plugin
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlpsql.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlpsql.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                    "MetaData": {
                    "Keys": [
                    "QPSQL"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QPSQLDriverPlugin",
                    "debug": false,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL")
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlpsqld.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlpsqld.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                    "MetaData": {
                    "Keys": [
                    "QPSQL"
                    ]
                    },
                    "archlevel": 0,
                    "className": "QPSQLDriverPlugin",
                    "debug": true,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlpsqld.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
                    not a plugin
                    qt.core.plugin.factoryloader: checking directory path "C:/Users/user/Documents/CP/build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release/release/sqldrivers" ...
                    qt.core.library: "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll" cannot load: Cannot load library C:\Qt\6.4.0\msvc2019_64\plugins\sqldrivers\qsqlmysql.dll: Das angegebene Modul wurde nicht gefunden.
                    qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "C:/Qt/6.4.0/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll" : "Cannot load library C:\Qt\6.4.0\msvc2019_64\plugins\sqldrivers\qsqlmysql.dll: Das angegebene Modul wurde nicht gefunden."
                    QSqlDatabase: QMYSQL driver not loaded
                    QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL
                    No Connection
                    qt.core.plugin.factoryloader: checking directory path "C:/Qt/6.4.0/msvc2019_64/plugins/accessiblebridge" ...
                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.0/msvc2019_64/plugins/accessiblebridge/qsqlmysql.dll"
                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.0/msvc2019_64/plugins/accessiblebridge/qsqlmysql.dll, metadata=
                    {
                    "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                    "MetaData": {
                    "Keys": [
                    "QMYSQL",
                    "QMARIADB"
                    ]
                    },
                    "archlevel": 2,
                    "className": "QMYSQLDriverPlugin",
                    "debug": false,
                    "version": 394240
                    }

                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList()
                    qt.core.plugin.factoryloader: checking directory path "C:/Users/user/Documents/CP/build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release/release/accessiblebridge" ...

                    1 Reply Last reply
                    0
                    • hskoglundH Offline
                      hskoglundH Offline
                      hskoglund
                      wrote on last edited by hskoglund
                      #24

                      Hi, the output looks good, only one more step should remain, you need to copy the mysql driver dll to the same folder as where your app .exe file is.

                      The driver dll file is called libmysql.dll and it should be in the C:\Program Files\MySQL\MySQL Server 8.0\lib (provided that you've installed the 64-bit MySQL Installer 8.0.22)
                      So if I'm guessing correctly then the copy command is:
                      copy "C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.dll" C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\release

                      If you cannot find it (or haven't installed the MyQSL Installer) then there are plenty of alternatives for downloading that libmysql.dll file, for example here

                      A 1 Reply Last reply
                      0
                      • hskoglundH hskoglund

                        Hi, the output looks good, only one more step should remain, you need to copy the mysql driver dll to the same folder as where your app .exe file is.

                        The driver dll file is called libmysql.dll and it should be in the C:\Program Files\MySQL\MySQL Server 8.0\lib (provided that you've installed the 64-bit MySQL Installer 8.0.22)
                        So if I'm guessing correctly then the copy command is:
                        copy "C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.dll" C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\release

                        If you cannot find it (or haven't installed the MyQSL Installer) then there are plenty of alternatives for downloading that libmysql.dll file, for example here

                        A Offline
                        A Offline
                        AlexFr
                        wrote on last edited by
                        #25

                        @hskoglund Hi. thanks for the answer. it however did not help. I still get the exact same error as above.

                        1 Reply Last reply
                        0
                        • hskoglundH Offline
                          hskoglundH Offline
                          hskoglund
                          wrote on last edited by hskoglund
                          #26

                          Hi, even though you successfully copied libmysql.dll to where your .exe file is, perhaps it still fails because the .dlls that libmysql.dll depend on are not in your path. The files are libssl-1_1-x64.dll and libcrypto-1_1-x64.dll.

                          They also need to be copied to the same directory where your .exe file is, try (note: I'm guessing where they are on your PC):
                          copy C:\mysql-8.0.22-winx64\lib\libssl-1_1-x64.dll C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\release
                          and
                          copy C:\mysql-8.0.22-winx64\lib\libcrypto-1_1-x64.dll C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\release

                          P.S. If it still fails, could you post a directory listing of the files in the directory where your .exe file is, I'm guessing it is: C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\release?

                          Edit: googled a bit more, there's an easier way to fix those 2 missing .dlls: install the MySQL Community Downloads MySQL Installer for Windows It's free but it requires an Oracle login :-( but perhaps you already have one)

                          A 1 Reply Last reply
                          0
                          • hskoglundH hskoglund

                            Hi, even though you successfully copied libmysql.dll to where your .exe file is, perhaps it still fails because the .dlls that libmysql.dll depend on are not in your path. The files are libssl-1_1-x64.dll and libcrypto-1_1-x64.dll.

                            They also need to be copied to the same directory where your .exe file is, try (note: I'm guessing where they are on your PC):
                            copy C:\mysql-8.0.22-winx64\lib\libssl-1_1-x64.dll C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\release
                            and
                            copy C:\mysql-8.0.22-winx64\lib\libcrypto-1_1-x64.dll C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\release

                            P.S. If it still fails, could you post a directory listing of the files in the directory where your .exe file is, I'm guessing it is: C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\release?

                            Edit: googled a bit more, there's an easier way to fix those 2 missing .dlls: install the MySQL Community Downloads MySQL Installer for Windows It's free but it requires an Oracle login :-( but perhaps you already have one)

                            A Offline
                            A Offline
                            AlexFr
                            wrote on last edited by
                            #27

                            @hskoglund Hey thank you for taking the time to help me fix this.
                            I tried what you said, and it still does not work. I already have mysql installed, but I can uninstall and install it again.

                            1 Reply Last reply
                            0
                            • hskoglundH Offline
                              hskoglundH Offline
                              hskoglund
                              wrote on last edited by
                              #28

                              Hi, could you post a directory listing where your .exe file is so that the file dates and sizes are visibile.(perhaps there is a mismatch between the Release and Debug versions of the 3 MySQL files).

                              A 1 Reply Last reply
                              0
                              • hskoglundH hskoglund

                                Hi, could you post a directory listing where your .exe file is so that the file dates and sizes are visibile.(perhaps there is a mismatch between the Release and Debug versions of the 3 MySQL files).

                                A Offline
                                A Offline
                                AlexFr
                                wrote on last edited by
                                #29

                                @hskoglund Hey. Here is the directory listing:

                                DatabaseConnection.exe
                                FolderList.txt
                                libcrypto-1_1-x64.dll
                                libmysql.dll
                                libssl-1_1-x64.dll
                                main.obj
                                mainwindow.obj
                                moc_mainwindow.cpp
                                moc_mainwindow.obj
                                moc_predefs.h

                                1 Reply Last reply
                                0
                                • hskoglundH Offline
                                  hskoglundH Offline
                                  hskoglund
                                  wrote on last edited by
                                  #30

                                  Hi, looks good, but to check you've got the right versions, please also provide:
                                  the path of the folder, for example C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\release
                                  the times and dates of all the files in the folder
                                  the sizes in bytes of all the files in the folder

                                  A 1 Reply Last reply
                                  0
                                  • hskoglundH hskoglund

                                    Hi, looks good, but to check you've got the right versions, please also provide:
                                    the path of the folder, for example C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_4_0_MSVC2019_64bit-Release\release
                                    the times and dates of all the files in the folder
                                    the sizes in bytes of all the files in the folder

                                    A Offline
                                    A Offline
                                    AlexFr
                                    wrote on last edited by
                                    #31

                                    @hskoglund Hey I am sorry for replying so late. Here goes:

                                    DatabaseConnection.exe 18.06.2022 18:22 28 KB
                                    libcrypto-1_1-x64.dll 16.03.2022 09:45 2.803 KB
                                    libmysql.dll 16.06.2020 20:53 6.647 KB
                                    libssl-1_1-x64.dll 16.03.2022 09:45 671 KB
                                    main.obj 18.06.2022 18:22 7KB
                                    mainwindow.obj 18.06.2022 18:22 29 KB
                                    moc_mainwindow.cpp 18.06.2022 18:22 3 KB
                                    moc_mainwindow.obj 18.06.2022 18:22 4 KB
                                    moc_predefs.h 18.06.2022 18:22 1KB

                                    The path to the files is exactly what is in your comment.
                                    I look forward to your reaction.
                                    thanks in advance.

                                    1 Reply Last reply
                                    0
                                    • hskoglundH Offline
                                      hskoglundH Offline
                                      hskoglund
                                      wrote on last edited by
                                      #32

                                      Hi, libmysql.dll is not from the same year as libcrypto-1_1-x64.dll and ibssl-1_1-x64.dll, that could be a problem. I don't think that's the reason for the error though.

                                      I think you need to use a version of Qt that is not a beta release but a "real" release. That means installing the Qt 6.3.1 MSVC 2019 64-bit version. Then rebuild your app with that version of Qt.

                                      To avoid rebuilding the MySQL plugin for Qt version 6.3.1 you can download it from here

                                      When you open the zip, place the3 files libcrypto-1_1-x64.dll, libmysql.dll and libssl-1_1-x64.dll in the same folder as your .exe file (I'm guessing C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_3_1_MSVC2019_64bit-Release\release)
                                      then open the subdirectory sqldrivers in the .zip file and copy the 2 files qsqlmysql.dll and qsqlmysqld.dll to the plugins folder of your newly installed Qt version 6.3.1, I'm guessing: C:\Qt\6.3.1\msvc2019_64\plugins\sqldrivers

                                      A 1 Reply Last reply
                                      1
                                      • hskoglundH hskoglund

                                        Hi, libmysql.dll is not from the same year as libcrypto-1_1-x64.dll and ibssl-1_1-x64.dll, that could be a problem. I don't think that's the reason for the error though.

                                        I think you need to use a version of Qt that is not a beta release but a "real" release. That means installing the Qt 6.3.1 MSVC 2019 64-bit version. Then rebuild your app with that version of Qt.

                                        To avoid rebuilding the MySQL plugin for Qt version 6.3.1 you can download it from here

                                        When you open the zip, place the3 files libcrypto-1_1-x64.dll, libmysql.dll and libssl-1_1-x64.dll in the same folder as your .exe file (I'm guessing C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_3_1_MSVC2019_64bit-Release\release)
                                        then open the subdirectory sqldrivers in the .zip file and copy the 2 files qsqlmysql.dll and qsqlmysqld.dll to the plugins folder of your newly installed Qt version 6.3.1, I'm guessing: C:\Qt\6.3.1\msvc2019_64\plugins\sqldrivers

                                        A Offline
                                        A Offline
                                        AlexFr
                                        wrote on last edited by
                                        #33

                                        @hskoglund said in QSqlDatabase: QMYSQL driver not loaded:

                                        Hi, libmysql.dll is not from the same year as libcrypto-1_1-x64.dll and ibssl-1_1-x64.dll, that could be a problem. I don't think that's the reason for the error though.

                                        I think you need to use a version of Qt that is not a beta release but a "real" release. That means installing the Qt 6.3.1 MSVC 2019 64-bit version. Then rebuild your app with that version of Qt.

                                        To avoid rebuilding the MySQL plugin for Qt version 6.3.1 you can download it from here

                                        When you open the zip, place the3 files libcrypto-1_1-x64.dll, libmysql.dll and libssl-1_1-x64.dll in the same folder as your .exe file (I'm guessing C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_3_1_MSVC2019_64bit-Release\release)
                                        then open the subdirectory sqldrivers in the .zip file and copy the 2 files qsqlmysql.dll and qsqlmysqld.dll to the plugins folder of your newly installed Qt version 6.3.1, I'm guessing: C:\Qt\6.3.1\msvc2019_64\plugins\sqldrivers

                                        It worked. Thanks a lot @hskoglund . To anyone struggling with the same issue, the quoted steps are precisely what you should follow to solve your problem.

                                        Thanks a million @hskoglund you are so kind.

                                        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