The first thing is to download the connector installer, depending on the version of the compiler you are using, 64 or 32 bits, for c from here: https://downloads.mysql.com/archives/cc/
locate the connector installation folder and run these commands.
cd% QTDIR% \ 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"
mingw32-make
mingw32-make install
Here you can see the official Qt documentation. https://doc.qt.io/qt-5/sql-driver.html#qmysql
and with that you would have everything ready, good luck.
note. don't forget to include the sql module in your.pro file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.