It is all in the documentation. You have two different ways to do it:
- Building the Drivers Using Configure. You build and install the MySQL plugin as you build and install the Qt library itself, OR
- How to Build the QMYSQL Plugin on Windows. You build and install the plugin on its own after you have built and installed Qt.
Pick one.
For option 1: You use the Qt configure script to tell Qt to build the plugin, then build Qt, install Qt, done. Here is an example. It is not exactly what you type. You have to adapt it to your system
cd {qt source dir}
configure {... other options ...} -Ic:/mysql/include -Lc:/mysql/lib -lmysql -plugin-sql-mysql
nmake
nmake install
cd {qt source dir}
configure {... other options ...} -Ic:/mysql/include -Lc:/mysql/lib -lmysql -plugin-sql-mysql
nmake
nmake install
To copy to clipboard, switch view to plain text mode
For option 2: You move to the plugin source directory, run qmake with some options, make, install, done. Here is an example. It is not exactly what you type. You have to adapt it to your system
cd %QTDIR%\src\plugins\sqldrivers\mysql
qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
nmake
nmake install
cd %QTDIR%\src\plugins\sqldrivers\mysql
qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
nmake
nmake install
To copy to clipboard, switch view to plain text mode
You might recognise that as being exactly what is in the manual with the install step added.
If you already have Qt and MySql installed the total time for Option 2 is less than ten minutes.
Bookmarks