[PyQt] Compile PyQt with mysql driver support

Nahuel Defossé nahueldefosse at yahoo.com.ar
Thu Mar 12 08:40:32 GMT 2009


El Monday 09 March 2009 17:58:18 Nahuel Defossé escribió:
> Hi,
> after some google searches I discovered that I had to recompile PyQt to get
> MySql support on windows. So I donwloaded Qt 4.4.3 from Trolltech (the
> version recompiled and bundled with mingw), sip 4.7.9 and pyqt source
> 4.4.4. I compiled sip with no problems. Then I compiled Qt's mysql driver
> plugin folowing the Qt wiki[1]. I didn't compile whole Qt library but just
> the plugin.
> Then I compiled PyQt4, except for some problems with some definitions in qt
> headers, everything went fine. I did not pass anything but the platform to
> configure.py, I thought it might take Qt current config. After compilation
> I tested QtSql module and there is no mysql driver, just sqlite and odbc.
> Am I doing something wrong?
>
> I suspect it absolutely necessary to recompile Qt (since [1] suggests to do
> so), but I thught maybe if it's just a plugin, it could be built
> independently.
>
> Thanks
> Nahuel
> [1]
> http://wiki.qtcentre.org/index.php?title=Building_the_QMYSQL_plugin_on_Wind
>ows_using_mingw _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

I managed to compile the driver, I copied libmysql.dll into PyQt4 
site-packages folder, but I get this strange message:

QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL3 QMYSQL QODBC3 QODBC

Is there something explicit to load a sql driver on windows?


Nahuel



More information about the PyQt mailing list