1. Windows platform:
Note: The QT installation path is D: \ QT; the MySQL installation path is F: \ mysql
Open a nameorder prompt
1> D: \ QT \ 2010.05 \ QT \ SRC \ plugins \ sqldrivers \ mysql> (switch to this directory)
2> qmake-O makefile "includepath + = F:/MySQL/include" "libs + = F:/MySQL/lib/libmysql. lib "MySQL. pro (note that '/' is not '\')
3> mingw32-make (if not found, add mingw/bin to the environment variable)
If the driver cannot be loaded, run libmysql in F:/MySQL/lib. place the DLL in D: \ QT \ 2010.05 \ QT \ bin. The specific path is determined by the installation path (F:/MySQL/is the MySQL installation path)
2. Linux platform:
1 install MySQL sudo apt-Get install mysql-Server
2 install libmysqlclient15-dev sudo
Apt-Get install libmysqlclient15-dev
3 "CD $ qtdir/src/plugins/sqldrivers/MySQL //Go to the QT directory that stores the MySQL driver source code''
4. qmake "includepath + =/usr/include/MySQL" "libs + =-L/usr/lib/MySQL
-Lmysqlclient_r "mysql. Pro
5 "make
6 "make install
The $ qtdir/plugins/sqldrivers directory contains libqsqlmysql. So, Which is QT.
MySQL driver