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. Building QMYSQL / MARIADB with Qt 6.3.0
Forum Update on Monday, May 27th 2025

Building QMYSQL / MARIADB with Qt 6.3.0

Scheduled Pinned Locked Moved Unsolved Qt 6
qmysqlmariadb3.6.0
13 Posts 2 Posters 2.3k 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.
  • S SGaist
    10 Jun 2022, 19:20

    Hi and welcome to devnet,

    If memory serves well, the online installer also provides the option to install cmake.

    As for the loading issue, start your application with the QT_DEBUG_PLUGINS environment variable set to 1. You can do that in the Run part of the Project panel.

    A Offline
    A Offline
    AnUnusualRemote
    wrote on 11 Jun 2022, 19:02 last edited by AnUnusualRemote 6 Nov 2022, 19:05
    #4

    Sorry, I have done that correct, I just found it.
    That doesn't seem to have done anything, in fact it was already set towards 1 when I checked. The online installer also seems to have CMake 3.21.1 64-bit showing as installed under Developer and Designer Tools.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 11 Jun 2022, 19:29 last edited by
      #5

      If the environment variable is properly defined, you should have a dump of information about the plugins being loaded and why they failed.

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

      A 1 Reply Last reply 11 Jun 2022, 20:09
      0
      • S SGaist
        11 Jun 2022, 19:29

        If the environment variable is properly defined, you should have a dump of information about the plugins being loaded and why they failed.

        A Offline
        A Offline
        AnUnusualRemote
        wrote on 11 Jun 2022, 20:09 last edited by
        #6

        @SGaist
        I'm assuming this would be

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

        Along with this line.

        qt.core.library: "C:/Qt/6.3.0/mingw_64/plugins/sqldrivers/qsqlmysql.dll" cannot load: Cannot load library C:\Qt\6.3.0\mingw_64\plugins\sqldrivers\qsqlmysql.dll: The specified module could not be found.
        qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "C:/Qt/6.3.0/mingw_64/plugins/sqldrivers/qsqlmysql.dll" : "Cannot load library C:\\Qt\\6.3.0\\mingw_64\\plugins\\sqldrivers\\qsqlmysql.dll: The specified module could not be found."
        

        sqldriver folder containing .dll files
        Since that's the sqldriver folder, I checked. Results are above. I can only guess that there's a missing .debug file, or that the .dll is incompatible with Qt for some reason.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 12 Jun 2022, 06:48 last edited by
          #7

          Maybe a silly question but are you sure that the dll you have now is from the correct compiler ?

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

          A 1 Reply Last reply 12 Jun 2022, 15:28
          0
          • S SGaist
            12 Jun 2022, 06:48

            Maybe a silly question but are you sure that the dll you have now is from the correct compiler ?

            A Offline
            A Offline
            AnUnusualRemote
            wrote on 12 Jun 2022, 15:28 last edited by
            #8

            @SGaist
            Very likely that it may not be from the right compiler, I could not compile it, so I asked a friend to instead. I suppose my best option right now is to try and build everything myself.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 12 Jun 2022, 17:56 last edited by
              #9

              You do not have to rebuild everything. Just the plugin.

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

              A 1 Reply Last reply 13 Jun 2022, 01:15
              0
              • S SGaist
                12 Jun 2022, 17:56

                You do not have to rebuild everything. Just the plugin.

                A Offline
                A Offline
                AnUnusualRemote
                wrote on 13 Jun 2022, 01:15 last edited by
                #10

                @SGaist
                I'm not entirely sure how to build it based on the documentation. I have the files for MariaDB location in the right folders when it comes to the .lib, .dll and .h files. Problem is that I'm not sure where I should be for building the plugins when it comes to the command prompt.

                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 .
                

                I'm not entirely sure where I should be located within my file structure to build the plugins, inside of the Qt 6.3.0 folder? The bin folder of the Qt 6.3.0 folder perhaps? qt-cmake doesn't seem to be recgonised as a command, so I assume it's located somewhere inside of the Qt folder.

                'qt-cmake' is not recognized as an internal or external command, operable program or batch file.
                

                I also do not know what Ninja refers to within the command. Do I need to install this too?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 13 Jun 2022, 21:14 last edited by
                  #11

                  Try with just cmake in place of qt-cmake.

                  As for Ninja, it's also available through the installer.

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

                  A 1 Reply Last reply 13 Jun 2022, 23:33
                  0
                  • S SGaist
                    13 Jun 2022, 21:14

                    Try with just cmake in place of qt-cmake.

                    As for Ninja, it's also available through the installer.

                    A Offline
                    A Offline
                    AnUnusualRemote
                    wrote on 13 Jun 2022, 23:33 last edited by
                    #12

                    @SGaist
                    Since I'm using and building for MariaDB

                    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"
                    

                    The DMySQL and DMySQL_LIBRARY should probably be replaced with DMariaDB or some equivalent, correct? The locations will change, but obviously those are where I've installed the relevant files.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 15 Jun 2022, 20:35 last edited by
                      #13

                      From memory, no, MariaDB is a drop in replacement so it would not make sense to complicate the build system for that.

                      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

                      13/13

                      15 Jun 2022, 20:35

                      • Login

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