QMYSQL driver not loaded

2019-06-08 21:22发布

问题:

I have compiled qmysql driver plugin and placed debug and release .dll and .lib files in \plugins\sqldrivers. But when i try qDebug() << QSqlDatabase::drivers(); it still get ("QSQLITE", "QODBC3", "QODBC", "QPSQL7", "QPSQL")and QMYSQL driver is not available.Any idea?

Qt version : 4.8.4
Compiler : MSVC2010

OS : windows vista (64bit)

回答1:

Your application needs libmysql.dll which you can find in the MySQL installation directory. You can copy it to the Qt bin directory or in the same directory of your .exe

Note that you need to restart your IDE (Qt Creator or what ever IDE) after you place new dll files in \plugins\sqldrivers or Qt bin directory.



标签: qt qt4