The DB2, Oracle and TDS client drivers are not distributed with the Qt Open Source Editions, because the client libraries are distributed under a license which is not compatible with the GPL license. I don't know since when the MySQL driver for Qt is not equipped in the distribution. So we have to compile the qsqlmysql.dll file ourselves.
Download MySQL installer to install MySQL Connector C
Download Qt Source code
cd C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers qmake -- MYSQL_INCDIR="C:/Program Files/MySQL/MySQL Connector C 6.1/include" MYSQL_LIBDIR="C:/Program Files/MySQL/MySQL Connector C 6.1/lib"
If MySQL is not found, checking config.log under the current folder is very useful for finding out the problem
nmake namke install
The built dlls will be under C:\Qt\Qt5.12.5\5.12.5\msvc2017_64\plugins\sqldrivers
Copy the dll under your application folder\sqldrivers
Run the application