Тёмный

Qt5 C++ Connecting Qt Application To Mysql Database #28 

Parwiz Forogh
Подписаться 47 тыс.
Просмотров 54 тыс.
50% 1

Join Qt6 C++ GUI & Mobile App Development Course in Udemy
www.udemy.com/course/qt6-c-gu...
Hello RU-vidrs, In this video tutorial we are going to talk about Qt database programming.
particularly in this video we want to learn how you can Connect your Qt Application To Mysql Database for Mysql Database purpose we are using wamp server
Download DLL
www.dll-files.com/libmysql.dl...

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

 

3 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 71   
@XezolPL
@XezolPL 5 лет назад
Thank you good man for this tuttorial. Subscribed :)
@AniketKumar-bm8gi
@AniketKumar-bm8gi 4 года назад
Your videos are awesome.
@davidmoralesguerrero634
@davidmoralesguerrero634 5 лет назад
Nice video! But I think is better using ....//Previous code if(db.open()){ QMessageBox::information(this, "Connection", "Database Connected"); }else{ QSqlError error = db.lastError(); //With this you get to know better why the connection failed QMessageBox::information(this, "Connection", error.databaseText()); //if you change databaseText() by text() you get the error reported by the driver and the database } Again thanks for the video, especially the part about the dlls
@ayedecoder5896
@ayedecoder5896 4 года назад
If anyone is using the code below in their mainwindow.cpp file: if (db.open()){ QMessageBox::information(this, "Connection", "Database connected"); } else{ // QMessageBox::information(this, "Not Connected", "Connection failed"); QSqlError err=db.lastError(); } Please also remember to add the last line of code below to your mainwindow.h file #include #include #include #include #include
@julkamac3074
@julkamac3074 2 года назад
Jnsc0
@biscuit4431
@biscuit4431 4 года назад
Best Tutorial! Like!!!!!!!!!!!!!!!
@Chris-Ober
@Chris-Ober 5 лет назад
I put these two dll's in every bin folder i could find.. it didnt work :( Always still the same error that you got in the first place
@birambawo1976
@birambawo1976 4 года назад
Hey Chris, did u solve your problem ? I am getting the same issue.
@juliocesarcamargoamaro2307
@juliocesarcamargoamaro2307 4 года назад
@@birambawo1976 Did you find a way to solve this problem ?
@omarsabbagh4754
@omarsabbagh4754 4 года назад
@@juliocesarcamargoamaro2307 you guys found a solution for that. I'ts also not working for me!
@PaoloValerdi
@PaoloValerdi 3 года назад
For anyone stuck with this issue, all you need to do is copying those dll to your build folder (which is relative to your projects folder) so let's say your project folder is located in .../Documents/My project/ then your build folder will be located in .../Documents/ Most of the time this build folder will have a name similar to the compiler your using so you can easily locate it. Just paste those dll in that build folder and it will work
@nelsonlerma6081
@nelsonlerma6081 5 лет назад
Hi. Very nice this tutorial. Congratulations. I saw you didn´t use the MySql connector. Do this means that the Qt Creator already has de needed drivers? Do ya think it isn´t needed? Thanks for your attention.
@ParwizForogh
@ParwizForogh 5 лет назад
yea but if you are using mysql u need to add the required dll and if you are using sqlite there is no need of dlls
@nelsonlerma6081
@nelsonlerma6081 5 лет назад
Yes. I work with Delphi and MySql. I want to migrate to c++. In my machine I already have the MySql instaled. Maybe this is why it worked easily. Thanks.
@hiteshmitruka9770
@hiteshmitruka9770 4 года назад
Please make a tutorial on building mysql driver for android
@cdunne1620
@cdunne1620 7 месяцев назад
Hi, If the database is sitting on an online server will I still be able to connect in a similar way or is it much more complicated?
@marcinlesniewski4571
@marcinlesniewski4571 3 года назад
elegancko
@hooraabootalebi6827
@hooraabootalebi6827 3 года назад
Do you have any solution for driver error in ubuntu?
@ParwizForogh
@ParwizForogh 3 года назад
You can support me on Patreon www.patreon.com/parwizforogh
@muhammadabdullah-zl2gb
@muhammadabdullah-zl2gb 4 года назад
Pls how can I download the two files in linux mint 32bit
@0311pjs
@0311pjs 5 лет назад
What is your database version??
@dadinjones4040
@dadinjones4040 7 месяцев назад
vedio is good , but i need sqlserve
@alfredm.s.6396
@alfredm.s.6396 4 года назад
doesnt work with those two dll files
@Logan-fi2zg
@Logan-fi2zg Месяц назад
Try to turn off the shadow build in project window.
@ChoudharyRamesh
@ChoudharyRamesh 4 года назад
Still getting problem with QMYSQL driver not loaded . Is this problem occurs due to i don't have QMYSQL driver in plugin/sqldriver ? Thank you .
@ParwizForogh
@ParwizForogh 4 года назад
you need to add the dll driver in the specific folder that is mentioned in the video
@thesoftwareproject5798
@thesoftwareproject5798 2 года назад
how do you fix this error: " QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC QPSQL "
@ecchisenseisvault
@ecchisenseisvault 4 года назад
hi sir i got little problem when i run in ubuntu how to configure mysql drivers in ubuntu with qt5 please put a video about configuring qt5 with mysql in ubunut
@shibadityachakraborty4369
@shibadityachakraborty4369 Год назад
sudo apt-get install libqt5sql5-mysql
@sevarshadan1979
@sevarshadan1979 7 месяцев назад
@@shibadityachakraborty4369 I just did that but unfortunately didn't work☹️
@adjiefajarramadhan3739
@adjiefajarramadhan3739 4 года назад
Does this works with qt in raspberry pi with raspbian os ?
@ParwizForogh
@ParwizForogh 4 года назад
this is for qt5 C++, but for python you can use pyqt5 i have complete video on pyqt5
@ajoydev8876
@ajoydev8876 3 года назад
My Database connected but i cannot see the database....Why??
@melodicWonders
@melodicWonders 3 года назад
I'm on this for 4 days now, trying to solve why my database gets connected but the data doesn't get inserted. Anyone with the same issue was able to solve it?
@jericho239
@jericho239 3 года назад
SAME ISSUE!
@sadabwasi9874
@sadabwasi9874 4 года назад
I only have these database drivers "QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7" Don't have "QMYSQL" and "QMYSQL3" drivers. Can you please help with how can I get them?
@ParwizForogh
@ParwizForogh 4 года назад
i have said this in the video you can check the video
@sadabwasi9874
@sadabwasi9874 4 года назад
@@ParwizForogh Thank you for replying. What I actually wanted to know is that in your video at 6:54, when you run your program, you receive an error that Database not connected due to 'QSqlDatabase: QMYSQL driver not loaded' and 'QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7'. then you copy the two dll files to fix it. But in my case I receive 'QSqlDatabase: QMYSQL driver not loaded' and 'QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7' and 'QSqlError("", "Driver not loaded", "Driver not loaded")'. I tried coping the two dll files, but it doesn't fix my error.
@aitsaidmouaad113
@aitsaidmouaad113 4 года назад
@@sadabwasi9874 me too,
@ivanenzhaev2373
@ivanenzhaev2373 3 года назад
QMYSQL isn't in this list of available drivers because "qsqlmysql.dll" isn't in this folder: C:\Qt\5.15.2\mingw81_32\plugins\sqldrivers
@MudassirKhan-sx9jy
@MudassirKhan-sx9jy Год назад
i get error as QSql file not found
@ramabhusal7435
@ramabhusal7435 5 месяцев назад
i do many time but still show same error : QSqlDatabase: available drivers: QSQLITE QMIMER QODBC QPSQL QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMIMER QODBC QPSQL QSqlDatabasePrivate::addDatabase: duplicate connection name 'qt_sql_default_connection', old connection removed. QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMIMER QODBC QPSQL QSqlDatabasePrivate::addDatabase: duplicate connection name 'qt_sql_default_connection', old connection removed.
@Logan-fi2zg
@Logan-fi2zg Месяц назад
Try to turn off the shadow build in project window.
@lucas.mendes
@lucas.mendes 5 лет назад
Does it work with remote database?
@ParwizForogh
@ParwizForogh 5 лет назад
yea just change the localhost information
@adjiefajarramadhan3739
@adjiefajarramadhan3739 4 года назад
Change the localhost with what ? The ip server ?
@saidgalindo6661
@saidgalindo6661 4 года назад
@@ParwizForogh I did it and still not work
@ahmedcharfeddine2161
@ahmedcharfeddine2161 3 года назад
No, didn't work for me, i downloaded both DDL files, tho idk 32 or 64 bits, what should it be ?, i have mingw32, and i tried both
@ahmedcharfeddine2161
@ahmedcharfeddine2161 3 года назад
Nvm it worked, just install it in bin that has your compiler name, i followed the steps of a fella below in the comments
@s_h_o_k1836
@s_h_o_k1836 5 лет назад
It didn't help
@ParwizForogh
@ParwizForogh 5 лет назад
can you tell me that where you face to problem
@s_h_o_k1836
@s_h_o_k1836 5 лет назад
@@ParwizForogh I copy those files and it still doesn't find drivers
@gneiazmah2129
@gneiazmah2129 5 лет назад
@@ParwizForogh same problem occurred... how can i fix this?
@ParwizForogh
@ParwizForogh 5 лет назад
u need to download the dlls and add me in the place that i have mentioned in the video, because that is required dlls
@s_h_o_k1836
@s_h_o_k1836 5 лет назад
@@ParwizForogh well as I said, I did it but it still doesn't work...
@tictactoc9311
@tictactoc9311 4 года назад
Still can't connect im using mingw btw
@tictactoc9311
@tictactoc9311 3 года назад
Still not. Qt is nonsense.
@ChandanKr.16
@ChandanKr.16 5 лет назад
Thanks Parwiz because of u I was able to complete my college project. Check that out m.ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IzTuVR1z1Ws.html
@ParwizForogh
@ParwizForogh 5 лет назад
welcome nice
Далее
Как похудеть на 10 кг ?!
07:06
Просмотров 622 тыс.
ЮТУБ ТОЧНО ВСЕ!
11:23
Просмотров 978 тыс.
Schoolboy - Часть 2
00:12
Просмотров 2,5 млн
BEST WAY to make Desktop Applications in C++
26:00
Просмотров 899 тыс.
Qt Crash Course for Beginners - Create C++ GUI Apps
30:34
Making Simple X11 GUI Window in C on Linux
8:18
Просмотров 23 тыс.
Qt Tutorial : C++ Notepad App
38:18
Просмотров 443 тыс.
MySQL - The Basics // Learn SQL in 23 Easy Steps
17:17
Просмотров 824 тыс.