MysqlPlugin

Qt MySQL plugin on Windows

On Windows, Qt ist installed without the (compiled) MySQL plugin.

Compiling the plugin

This description is valid for MinGW installed with the Qt SDK 4.8.0, MySQL Server 5.5.22, Windows 7.

Required Software:

  • Qt SDK with source code
  • MySQL "Client C API library", installed with the server (must be 32 bit!)

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.

References

Instructions:

Old instructions:

On plugins:

See also


Related

Wiki: Compiling

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.