On Windows, Qt ist installed without the (compiled) MySQL plugin.
This description is valid for MinGW installed with the Qt SDK 4.8.0, MySQL Server 5.5.22, Windows 7.
Required Software:
Compilation is described in this blog post. In a nutshell:
set qt=c:\qt set mysql=C:\PROGRA~2\MySQL\MYSQLS~1.5 cd %qt%\QtSources\4.8.0\src\plugins\sqldrivers\mysql\ qmake "INCLUDEPATH+=%mysql%\include" "LIBS+=%mysql%\lib\libmysql.lib" -o Makefile mysql.pro mingw32-make qmake "INCLUDEPATH+=%mysql%\include" "LIBS+=%mysql%\lib\libmysql.lib" -o Makefile mysql.pro "CONFIG+=release" mingw32-make
Then copy the generated .a and .dll files from debug/ and release/ to %qt%\Desktop\Qt\4.8.0\mingw\plugins\sqldrivers.
It may be necessary to update the plugin cache.
Use dir /X
to determine the short path names.
Instructions:
Old instructions:
On plugins: