Тёмный

Qt 6 | [Solved] QSqlDatabase: QMYSQL driver not loaded | Build QMYSQL Driver using CMake In Qt | Qt6 

Qt With Ketan
Подписаться 2,2 тыс.
Просмотров 6 тыс.
50% 1

Qt 6 | [Solved] QSqlDatabase: QMYSQL driver not loaded | Build QMYSQL Driver using CMake In Qt | Qt6
Keywords:
qt c++
qt c++ tutorial
qt c++ project
qt c++ full course
qt c++ visual studio
qt c++ projects
qt c++ for beginners
qt c++ install
qt c++ download
qt c++ desktop application
qt qml tutorial
qt qml c++ tutorial
qt qml interview questions
qt qml tutorial for beginners
qt gui tutorial c++
qt c++ gui
qt creator gui tutorial
qt gui tutorial
qt gui c++ example
gui c++ tutorial
qt application tutorial
c++ gui tutorial for beginners
c++ qt tutorial
c++ gui programming with qt 5
c++ qt gui
qt c++ gui tutorial for beginners
qt gui examples
qt designer tutorial c++
gui qt c++
youtube qt tutorial
qt c++ gui tutorial
c++ application tutorial
c++ app tutorial
c++ gui tutorial
c++ gui programming with qt 4
qt5 c++ tutorial
qt6 tutorial c++
qt 6 tutorial
qt creator tutorial c++
qt c++ app
c++ gui programming with qt 6
Qt C++ GUI Application Tutorial : • Qt C++ GUI Application...
Qt C++ Chart Application Tutorial : • Qt C++ Chart Applicati...
Qt C++ Core Application Tutorial : • Qt C++ Core Applicatio...
Qt C++ Multimedia Application Tutorial : • Qt C++ Multimedia Appl...
Qt C++ Network Application Tutorial : • Qt C++ Network Applica...
Qt C++ Concurrent Application Tutorial : • Qt C++ Concurrent Appl...
Qt C++ SerialPort Application Tutorial : • Qt C++ SerialPort Appl...
Qt C++ Positioning Application Tutorial : • Qt C++ Positioning App...
Qt With OpenCV : • Qt With OpenCV
Answers And Solved Problems : • Answers And Solved Pro...
Instagram : / qtwithketan
RU-vid : / @qtwithketan
Github : github.com/QtWithKetan
Don't forget to like, subscribe, and hit the notification bell to stay updated on our latest tutorials! If you have questions or suggestions, share them in the comments below. 💻📊 #qt #programming #c++

Опубликовано:

 

10 июл 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 95   
@user-mv2kn4yy9m
@user-mv2kn4yy9m 8 месяцев назад
Thank you so much. I solved the problem with this video.
@qtwithketan
@qtwithketan 8 месяцев назад
Thanks for watching my video. Glad you like my video. I Hope my videos are helpful for you.
@mirimohammed4250
@mirimohammed4250 2 месяца назад
Thank you so much.
@qtwithketan
@qtwithketan 2 месяца назад
Thanks for watching my video. Glad you like my videos. i hope my videos are helpful for you.
@user-bs6ve1ho5u
@user-bs6ve1ho5u 7 месяцев назад
Thank you , it helped me
@qtwithketan
@qtwithketan 7 месяцев назад
Thanks for watching my video. Glad you like my video. I Hope my videos are helpful for you.
@andreitarca4891
@andreitarca4891 11 месяцев назад
Do you have any idea of how can i do to include qmysql driver for android? On android emulator it shows me only the qsqlite driver
@dinordi9897
@dinordi9897 11 месяцев назад
It works for MinGW, what about MSVC2019? What steps am I missing
@alexngoumo7601
@alexngoumo7601 5 месяцев назад
Thanks for this video. With this integration, can we compile the application and have a MySQL server embedded in the deliverables? In other words, run the project on the end user's machine without having to install MySQL server.
@qtwithketan
@qtwithketan 5 месяцев назад
Thanks for watching my video. if you don't want to save your data in local machine then you do not need to install mysql server. or if you save the data on any specific server then you just have to deploy your application with required qt plugins. You Should watch this video. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yk9Byd8UPi8.html
@alexngoumo7601
@alexngoumo7601 5 месяцев назад
@@qtwithketan Hello, I would like to save my data in my local machine, during the development I can install mysql server or wamp in my machine and during the generation of the executable embed the mysql server in the executable so that the users (not computer scientist) of the application do not need to install again mysql server or wamp to run the application. an embedded database like Sqlite, but I want to do it with mysql.
@qtwithketan
@qtwithketan 5 месяцев назад
Are you trying to saying you want to store the data in mysql locally but without install the mysql server? All Requierd software installation process is part of deployment so if you need to store data in mysql locally then you have to install mysql in your machine.
@forgamesforme
@forgamesforme 9 месяцев назад
I've done all this but did it for msvc2019 instead and using make. I completed all steps including the final nmake install command and i can see the qsqlmysql.dll file has been created and i can run fine on release but i cant run on debug as i didn't seem to get a qsqlmysql.debug (.pdb) file created
@qtwithketan
@qtwithketan 9 месяцев назад
Thanks For watching my video. in this video you can see i was build mysql driver for mingw kit not for msvc2019 to build driver for msvc2019 there some different command for it.
@andreitarca4891
@andreitarca4891 11 месяцев назад
Hello Unfortunately, I don't have any src folder.... What can I do then?
@qtwithketan
@qtwithketan 11 месяцев назад
You can download from Qt Official Website Link : download.qt.io/archive/qt/
@andreitarca4891
@andreitarca4891 11 месяцев назад
@@qtwithketan I installed the Source Thank you very much, i did everything you have done in this video But, on CLion it says that there is no driver for sql. On the other hand, on the QTCreator app it recognizes it. Have you any idea about what can I do?
@paulkap12
@paulkap12 6 месяцев назад
I have done all the steps correctly and everything was completed correclty. Also the mysql files appeared in the directories. But when I go to QT and run the command "qDebug()
@qtwithketan
@qtwithketan 6 месяцев назад
Thanks For watching my video. 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.
@paulkap12
@paulkap12 6 месяцев назад
@@qtwithketan I am sorry for asking maybe stupid question, but I don't understand what do you mean "Application Run Directory". Especially I can't understand in the step 2, where should I put these files.
@qtwithketan
@qtwithketan 6 месяцев назад
Application Run Directory means when you build Or compile the Project it create an .exe file in folder. in simple terms where your application is located.
@paulkap12
@paulkap12 6 месяцев назад
@@qtwithketan Finally it worked! Copying these 2 .dll files solved the problem. You are perfect! Thank you!
@qtwithketan
@qtwithketan 6 месяцев назад
Sound like Good Glad You Like it. I hope you will doing great 👍
@HermosoBomboso
@HermosoBomboso 2 месяца назад
Hello Sorry to ask you again But i tried to download the src folder from the link in comment but i didn't know how I hope that you can help to download the src folder
@qtwithketan
@qtwithketan 2 месяца назад
Thanks for watching my video. No need to say sorry. Download Link : download.qt.io/archive/qt/ 1) Open The Link 2) Click Your Qt Version 3) Click Your Qt Version Of Main Qt Version 4) Now Click single 5) Now Click On the .zip Or .tar.xz File whatever you want to download.
@Clash-fu5zq
@Clash-fu5zq 5 месяцев назад
Hello, thanks for your video, but I've some issues, when I try to connect to mysql, it says "QMYSQL driver not loaded", I've tried what you said in different comments, but it didn't work neither, or maybe I miss understood what you meant, can you please help me please?
@qtwithketan
@qtwithketan 5 месяцев назад
Thanks for watching my videos. Yes, I can help you but you have to share the data and if you getting any error then share the error data and etc.. You can contact with me. You will get all contact details in about section. www.youtube.com/@qtwithketan/about
@Clash-fu5zq
@Clash-fu5zq 5 месяцев назад
@@qtwithketan It's okay, my teacher gave me the solution, I managed to make my project work, thank you for your help!
@qtwithketan
@qtwithketan 5 месяцев назад
@@Clash-fu5zq Thanks for watching my video. I Hope my videos are helpful for you.
@arantxavalencia7834
@arantxavalencia7834 2 месяца назад
@@Clash-fu5zq Hi, I have the same issue, how did you solve it?
@K3ster
@K3ster 4 месяца назад
Could you explain this for PostgreSQL?
@qtwithketan
@qtwithketan 4 месяца назад
Thanks for watching video For Build PSQL Driver And Connect PSQL Database With Qt Application You can Follow This Video : ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ss9B-LmZweA.html
@K3ster
@K3ster 4 месяца назад
@@qtwithketan video is private
@qtwithketan
@qtwithketan 4 месяца назад
You can watch the video. Now video is available for everyone.
@braver210
@braver210 Год назад
hey man after entering the final line it says : -> "cmake"' is not recognized as an internal or external command, operable program or batch file.
@qtwithketan
@qtwithketan Год назад
Did you follow all steps one by one. in 1st Step i set mingw32 and Cmake Enivorment path so follow all steps one by one and dont skip any step And Still you are getting problem then please drop your comment whatever problem are you faced with proper details.
@slawomirpiernikowski6150
@slawomirpiernikowski6150 5 месяцев назад
Ketan if you find some time it would be good to have it for MSVC2019_64bit
@qtwithketan
@qtwithketan 5 месяцев назад
Thanks for watching my video. You will get the video soon.
@ffilloux1897
@ffilloux1897 10 месяцев назад
bro i failed it so many times but i did it 😭😭 (I am on qt creator and i have use MYSQL server 8.01), you have to add "set QTDIR=C:\Qt\6.5.2\mingw_64" and "set PATH=%PATH%;C:\Qt\Tools\mingw1120_64\bin;C:\Qt\Tools\CMake_64\bin;C:\Qt\6.5.2\mingw_64\bin"
@qtwithketan
@qtwithketan 9 месяцев назад
Happy To Help. Thanks for watching video. Glad you like my videos.
@ArdaX95
@ArdaX95 6 дней назад
Hi, thank you for your video. I have managed to install the driver but I am getting an error like this when I try to connect to MySQL database: "QSqlDatabase: MYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMIMER QMARIADB QMYSQL QODBC QPSQL QList("QSQLITE", "QMIMER", "QMARIADB", "QMYSQL", "QODBC", "QPSQL") Failed to connect to database: "Driver not loaded Driver not loaded"" I checked C:\Qt\6.7.2\mingw_64\plugins\sqldrivers PATH and I can see the qsqlmysql.dll file created after I ran the commands which are described in the video. I also checked the C:\Qt\6.7.2\Src\qtbase\src\plugins\sqldrivers\mysql PATH and I can see a lot of files are generated. I even copied qmysql.dll file to the same location as with my application. Do you have an idea of what is going on?
@qtwithketan
@qtwithketan 6 дней назад
Thanks for watching my video. 1) Did you copy libmysql.dll file into your C:/Qt/6.7.2/mingw_64/bin directory.
@ArdaX95
@ArdaX95 5 дней назад
@@qtwithketan thank you for your reply! After your suggestion, I did copy libmysql.dll file into my C:/Qt/6.7.2/mingw_64/bin directory. Did clean/rebuilt the project but I saw the same error. Also, I added C:/Qt/6.7.2/mingw_64/bin to PATH environment variable of the system. I believe that since when I use the code "qDebug()
@ArdaX95
@ArdaX95 5 дней назад
@@qtwithketan Thank you for your reply! 1) Yes, I copied libmysql.dll file into my C:/Qt/6.7.2/mingw_64/bin directory. Cleaned and recompiled the project as it compiles successfully, I believe the compiled exe cannot find the mysql driver library somehow. 2) I also added C:/Qt/6.7.2/mingw_64/bin to PATH of system environment vaiable. 3) As I told you before, I copied qsqlmysql.dll to the same location as my exe 4) I tried dependency walker but it did not run on my Windows 11 I believe the drivers are successfully installed as I can see both QMARIADB QMYSQL on my driver list after I followed your steps when I use "qDebug()
@ArdaX95
@ArdaX95 5 дней назад
.
@ArdaX95
@ArdaX95 5 дней назад
​@@qtwithketan Thank you for your reply! 1) Yes, I copied libmysql.dll file into my C:/Qt/6.7.2/mingw_64/bin directory. Cleaned and recompiled the project as it compiles successfully, I believe the compiled exe cannot find the mysql driver library somehow. 2) I also added C:/Qt/6.7.2/mingw_64/bin to PATH of system environment vaiable. 3) As I told you before, I copied qsqlmysql.dll to the same location as my exe 4) I tried dependency walker but it did not run on my Windows 11 I believe the drivers are successfully installed as I can see both QMARIADB QMYSQL on my driver list after I followed your steps when I use "qDebug()
@adrianromaniuk1544
@adrianromaniuk1544 11 месяцев назад
Hello, I've done exactly as in the tutorial and all the files have been created correctly, but I'm using Python and compiling my project returns error: QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL Have you ever encountered this?
@qtwithketan
@qtwithketan 11 месяцев назад
Did you install Qt Properly ? Also Check Qt Enviroment Variable Path.
@glodie243
@glodie243 8 месяцев назад
​@@qtwithketan First of all I wanted to thank you for this tutorial video (I hadn't gotten anywhere for several months until I saw your video). However like @adrianromaniuk1544, I got the same error at the end: QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL - I installed Qt correctly (But I can always try again) - Qt enviroment variables Path (not very well understood)? Can you please help me if you have any idea about the problem?
@qtwithketan
@qtwithketan 8 месяцев назад
​@@glodie243 Thanks For watching my video. I am here for solve the problem just let me know Are you working with MinGW ? Which Version Of MySql Are You using ? did You try to copy libmysql.dll file in you application excutable directory path Or did you try to copy the sqldrivers plugins file in you application excutable directory path ?
@glodie243
@glodie243 8 месяцев назад
@@qtwithketan Thank you for replying, I work with Mingw. I added the library in my run directory and actually this line "QSqlDatabase: QMYSQL driver not loaded" disappeared, but my connection with MySQL Server is not working, maybe another problem with MySQL Server configuration . Thanks again from France
@qtwithketan
@qtwithketan 8 месяцев назад
​@@glodie243 I Hope Your problem is solved and my videos are helpful for you.
@4400kuba
@4400kuba 9 месяцев назад
How to make it for QIBASE Plugin? Can't find it anywhere
@qtwithketan
@qtwithketan 9 месяцев назад
Thanks for watching video. Can you please tell me which database server are you using from InterBase Or Firebird ?
@4400kuba
@4400kuba 9 месяцев назад
@@qtwithketan Firebird
@qtwithketan
@qtwithketan 9 месяцев назад
Did you try or follow the command which is mentioned in qt official documentation ?
@4400kuba
@4400kuba 8 месяцев назад
@@qtwithketan yeah, but I was struggling to get that point done. For some reason the file was not created without any errors. An video would be much appreciated. :)
@qtwithketan
@qtwithketan 8 месяцев назад
@@4400kuba No Problem, i will try to make simple video with proper solution about this problem.
@madgenius4533
@madgenius4533 14 дней назад
We need for msvc2019_64 bit 😔
@qtwithketan
@qtwithketan 13 дней назад
Thanks for watching my video. you can follow this video and i am sure you will get solution. Follow the below link. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-f-GC-b-Gtj8.html
@jskrunner7670
@jskrunner7670 Год назад
cant download QT6 servers are broken
@qtwithketan
@qtwithketan Год назад
use mirrors To download and Install Qt easily. Follow This ./installer(.exe) --mirror www.nic.funet.fi/pub/mirrors/download.qt-project.org
@S7vENSin
@S7vENSin 8 месяцев назад
Well that did not work
@qtwithketan
@qtwithketan 8 месяцев назад
Thanks for watching my videos. Can you please elaborate which kind of problem and error are you facing ?
@Noodles3535
@Noodles3535 11 месяцев назад
Great video. Any run into the issue on running the build get an error - "CMake Error: Could not create named generator MiniGW Mikefiles" E:\Qt\6.5.2\Src\qtbase\src\plugins\sqldrivers>call E:\Qt\6.5.2\mingw_64\bin\qt-cmake.bat -G "MiniGW Mikefiles" . -DMySQL_INCLUDE_DIR="E:\Program Files\MySQL\MySQL Server 8.1\include" -DMySQL_LIBRARY="E:\Program Files\MySQL\MySQL Server 8.1\lib\libmysql.dll" -DCMAKE_INSTALL_PREFIX="E:\Qt\6.5.2\mingw_64" -DCMAKE_C_COMPILER="gcc.exe" -DCMAKE_CXX_COMPILER="g++.exe"
@qtwithketan
@qtwithketan 11 месяцев назад
You have mistake in this command. Please watch video step by step and follow and don't make any spelling mistake in commands. Please see Video from here : 5:23
@user-mk5sb1uo5y
@user-mk5sb1uo5y 7 месяцев назад
@@qtwithketan, C:\Qt1\6.5.3\Src\qtbase\src\plugins\sqldrivers>call C:\Qt1\6.5.3\mingw_64\bin\qt-cmake.bat -G "MinGW MakeFiles" . -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="C:\Qt1\6.5.3\mingw_64" -DCMAKE_C_COMPILER="gcc.exe" -DCMAKE_CXX_COMPILER="g++.exe" The same problem, the same command as yours.
@user-mk5sb1uo5y
@user-mk5sb1uo5y 7 месяцев назад
I am stupid, sorry) @@qtwithketan
@qtwithketan
@qtwithketan 7 месяцев назад
@@user-mk5sb1uo5y I hope your problem was solved. If you need help then Don't Hesitate to Ask. Please like the video and subscribe the channel.
@richardvoogd1017
@richardvoogd1017 10 месяцев назад
at 8:45 my command prompt says cc1.exe: fatal error: Server\: No such file or directory compilation terminated. cc1.exe: fatal error: 8.0\include: No such file or directory compilation terminated. C:\Qt\Tools\mingw1120_64\bin\windres.exe: preprocessing failed. mingw32-make[2]: *** [mysql\CMakeFiles\QMYSQLDriverPlugin.dir\build.make:123: mysql/CMakeFiles/QMYSQLDriverPlugin.dir/QMYSQLDriverPlugin_resource.rc.obj] Error 1 mingw32-make[1]: *** [CMakeFiles\Makefile2:144: mysql/CMakeFiles/QMYSQLDriverPlugin.dir/all] Error 2 mingw32-make: *** [Makefile:145: all] Error 2 can you help me?
@slawomirpiernikowski6150
@slawomirpiernikowski6150 5 месяцев назад
see my post - actually the response: I found the solution: I changed MySQL Server 8.0 dir name to MySQL_Server_ 8.0 and result is [100%] Built target QSQLiteDriverPlugin - OK
Далее
I'm Excited To see If Kelly Can Meet This Challenge!
00:16
Do you even test? (your code with CMake)
12:38
Просмотров 20 тыс.
Создаем базу данных в Qt
7:27
Просмотров 28 тыс.
BEST WAY to make Desktop Applications in C++
26:00
Просмотров 899 тыс.
Menu Bar QT
3:41
Просмотров 94
I made the same game in Assembly, C and C++
4:20
Просмотров 689 тыс.
Water powered timers hidden in public restrooms
13:12
Просмотров 742 тыс.
Wait... PostgreSQL can do WHAT?
20:33
Просмотров 191 тыс.