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. I can't build MySQL driver
Forum Updated to NodeBB v4.3 + New Features

I can't build MySQL driver

Scheduled Pinned Locked Moved Solved Qt 6
9 Posts 3 Posters 1.1k 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
    _-mohamed-_
    wrote on last edited by _-mohamed-_
    #1

    I saw some instructions on different websites to build a MySQL driver but it didn't work with me

    first i opend qt cmd
    then i typed cd E:\Qt\6.2.2\Src\qtbase\src\plugins\sqldrivers in cmd
    then qmake -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Server 8.0\include" MYSQL_LIBDIR="C:\Program Files\MySQL\MySQL Server 8.0\lib"
    I should see like this:
    alt text
    but I got this:
    aa7b92df-57bc-4b03-ad6c-002a69b26548-image.png
    why? what did I do wrong?
    and thanks

    1 Reply Last reply
    0
    • _ Offline
      _ Offline
      _-mohamed-_
      wrote on last edited by
      #9

      I solved the problem by downloading the DLL files manually from the link:
      thecodemonkey86/qt_mysql_driver choose your qt version and download it's files

      And this is the video I followed and it helps me a lot:
      QT 6.1.2 DRIVER NOT LOADED/FOUND for MySQL drivers (ALWAYS UPDATED DRIVER-Links in the description)

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

        Hi,

        Why not follow the official documentation for doing 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
        • _ Offline
          _ Offline
          _-mohamed-_
          wrote on last edited by
          #3

          I followed it but it doesn't work with me
          I did the same steps, but I got the result shown in the picture

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

            You followed the instructions for Qt 5. They changed for Qt 6.

            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
              _-mohamed-_
              wrote on last edited by
              #5

              I previously had qt5.15 and I tried these instructions and it doesn't work, then I thought that was because I have an old version of qt, so I updated to qt6 and tried the same steps but I got the same result

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

                Please read the documentation I linked. There's no use of qmake to build the Qt 6 drivers.

                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
                • _ Offline
                  _ Offline
                  _-mohamed-_
                  wrote on last edited by
                  #7

                  ok now I wrote E:\Qt\6.2.2\mingw_64\bin\qt-cmake -G Ninja E:\Qt\6.2.2\Src\qtbase\src\plugins\sqldrivers -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Server 8.0\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" -DCMAKE_INSTALL_PREFIX="E:\Qt\6.2.2\mingw_64"
                  in the cmd and i got:
                  CMake Error: The source "E:/Qt/6.2.2/Src/qtbase/src/plugins/sqldrivers/CMakeLists.txt" does not match the source "E:/Qt/6.2.2/Src/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.

                  what should I do?

                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #8

                    @_-mohamed-_ said in I can't build MySQL driver:

                    what should I do?

                    Re-run cmake with a different source directory.

                    Maybe what cmake tells you?

                    Make sure no CMakeCache.txt is in your source and build tree and start over

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    1 Reply Last reply
                    0
                    • _ Offline
                      _ Offline
                      _-mohamed-_
                      wrote on last edited by
                      #9

                      I solved the problem by downloading the DLL files manually from the link:
                      thecodemonkey86/qt_mysql_driver choose your qt version and download it's files

                      And this is the video I followed and it helps me a lot:
                      QT 6.1.2 DRIVER NOT LOADED/FOUND for MySQL drivers (ALWAYS UPDATED DRIVER-Links in the description)

                      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