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. I Can't load the QMySQL with Qt 6 C++
Qt 6.11 is out! See what's new in the release blog

I Can't load the QMySQL with Qt 6 C++

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 868 Views
  • 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.
  • T Offline
    T Offline
    Tuanhoc8
    wrote on last edited by
    #1

    e7a510ae-b8d2-4bae-9156-60ab5aa591a6-image.png
    At the first time after make the mingw32-make and install, The QMYSQL still doesn't load. So I do with

    1. Copy the sqldrivers plugins Directory in you Application Run Directory
    2. Copy the libmysql.dll And libmysqld.dll in Your Application Run Directory
    3. Copy the libmysql.dll And libmysqld.dll in bin Directory Of Your Qt MinGW Kit Installed Directory.
    4. Also Check The MySQL Database Connection Parameter.
      The QMYSQL add in available drivers. But it doesn't load. Please check help me
    JonBJ 1 Reply Last reply
    0
    • T Tuanhoc8

      e7a510ae-b8d2-4bae-9156-60ab5aa591a6-image.png
      At the first time after make the mingw32-make and install, The QMYSQL still doesn't load. So I do with

      1. Copy the sqldrivers plugins Directory in you Application Run Directory
      2. Copy the libmysql.dll And libmysqld.dll in Your Application Run Directory
      3. Copy the libmysql.dll And libmysqld.dll in bin Directory Of Your Qt MinGW Kit Installed Directory.
      4. Also Check The MySQL Database Connection Parameter.
        The QMYSQL add in available drivers. But it doesn't load. Please check help me
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Tuanhoc8

      • Set environment variable QT_DEBUG_PLUGINS=1 in case better diagnostic information.
      • Purely at a guess, is the QMYSQL plugin built so it can be linked by your compiler/linker (e.g. it is not MSVC or a different bit-ness)?
      • Verify whether there are further DLLs which might need copying, perhaps extra dependencies --- use a dependency walker on the top-level QMYSQL DLL.
      • See whether it works if you compile for release.
      • Verify temporarily whether the QSQLITE does load.
      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tuanhoc8
        wrote on last edited by
        #3

        @JonB
        After add the QT_DEBUG_PLUGINS=1 The cmd show this and i see that QMYSQL is same with another sql. So I don't know @@
        qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QSQLITE")
        qt.core.plugin.factoryloader: looking at "qsqlmimer.dll"
        qt.core.plugin.loader: Found metadata in lib C:/Qt/6.8.3/mingw_64/plugins/sqldrivers/qsqlmimer.dll, metadata=
        {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
        "Keys": [
        "QMIMER"
        ]
        },
        "archlevel": 2,
        "className": "QMimerSQLDriverPlugin",
        "debug": false,
        "version": 395264
        }

        qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMIMER")
        qt.core.plugin.factoryloader: looking at "qsqlmysql.dll"
        qt.core.plugin.loader: Found metadata in lib C:/Qt/6.8.3/mingw_64/plugins/sqldrivers/qsqlmysql.dll, metadata=
        {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
        "Keys": [
        "QMYSQL",
        "QMARIADB"
        ]
        },
        "archlevel": 2,
        "className": "QMYSQLDriverPlugin",
        "debug": false,
        "version": 395264
        }

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

        qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QODBC")
        qt.core.plugin.factoryloader: looking at "qsqlpsql.dll"

        B 1 Reply Last reply
        0
        • T Tuanhoc8

          @JonB
          After add the QT_DEBUG_PLUGINS=1 The cmd show this and i see that QMYSQL is same with another sql. So I don't know @@
          qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QSQLITE")
          qt.core.plugin.factoryloader: looking at "qsqlmimer.dll"
          qt.core.plugin.loader: Found metadata in lib C:/Qt/6.8.3/mingw_64/plugins/sqldrivers/qsqlmimer.dll, metadata=
          {
          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
          "MetaData": {
          "Keys": [
          "QMIMER"
          ]
          },
          "archlevel": 2,
          "className": "QMimerSQLDriverPlugin",
          "debug": false,
          "version": 395264
          }

          qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMIMER")
          qt.core.plugin.factoryloader: looking at "qsqlmysql.dll"
          qt.core.plugin.loader: Found metadata in lib C:/Qt/6.8.3/mingw_64/plugins/sqldrivers/qsqlmysql.dll, metadata=
          {
          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
          "MetaData": {
          "Keys": [
          "QMYSQL",
          "QMARIADB"
          ]
          },
          "archlevel": 2,
          "className": "QMYSQLDriverPlugin",
          "debug": false,
          "version": 395264
          }

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

          qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QODBC")
          qt.core.plugin.factoryloader: looking at "qsqlpsql.dll"

          B Offline
          B Offline
          Bonnie
          wrote on last edited by Bonnie
          #4

          @Tuanhoc8 This is not what you should be looking for. These are information that tells you these plugins exist. But we already know that from your "available drivers" output.
          Find something like "loaded" or "cannot load" / “failed”.

          By the way, where is your libmysql.dll coming from? (You don't need to have libmysqld.dll though)
          If you get it from MySQL Server, I remember it depends on libopenssl so it needs libcrypto-3-x64.dll and libssl-3-x64.dll to load. You may use Dependencies tool to check that.
          (I highly recommend to build the plugin using the library from MariaDB instead of MySQL Server because it depends the least.)

          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