I've tried for the past 4 hours to get the MySQL connection with Qt/C++. There are a bunch of posts but they just don't work for me.
I've seen a lot of guides where you just have to move the the .dll files to a certain folder, but they don't work. Some say like place the files inside MinGW/plugins/mysql but I don't even have those folders present.
Then I saw this guide: Create MySQL driver for Qt5 on Windows where you seem to have to build your own driver, and I'm also struggling with this; but, why is this needed? Why other guides and users claim that all you have to do is to copy the files to a specific folder? Is it because a certain version of Qt or MySQL is needed? Which one should I download?
Error I'm getting:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7
Actual setup:
- Running Windows 10 64bits
- Qt Creator 4.9.1 - I must have messed up something the last time I re-installed Qt a few mins ago, because now it shows MSVC2017, but I was actually trying with MinGW first...
- MySQL 8.0.18
Thanks in advance.


QT_DEBUG_PLUGINSenvironment variable to 1 and attach the output debug information to your question.