I can't build MySQL driver
-
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 typedcd E:\Qt\6.2.2\Src\qtbase\src\plugins\sqldrivers
in cmd
thenqmake -- 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:
but I got this:
why? what did I do wrong?
and thanks -
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 filesAnd 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) -
Hi,
Why not follow the official documentation for doing that ?
-
I followed it but it doesn't work with me
I did the same steps, but I got the result shown in the picture -
You followed the instructions for Qt 5. They changed for Qt 6.
-
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
-
Please read the documentation I linked. There's no use of qmake to build the Qt 6 drivers.
-
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?
-
@_-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
-
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 filesAnd 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)