Error QMYSQL Plugin on Windows
-
Looks like you only built the plugin for release and not for debug and you are running a debug build of your application.
-
Add -debug to the qmake call
-
wrote on 1 Mar 2019, 23:50 last edited by Stelian 3 Feb 2019, 08:41
@SGaist I've called the qmake in debug mode, run the code and again Database is Not Connected!
Then again, I have start the application with the QT_DEBUG_PLUGINS environment variable and I get the next messageQFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers" ... QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlite.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlite.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QSQLITE" ] }, "archreq": 0, "className": "QSQLiteDriverPlugin", "debug": false, "version": 330752 } "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlite.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" not a plugin QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlited.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlited.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QSQLITE" ] }, "archreq": 1, "className": "QSQLiteDriverPlugin", "debug": true, "version": 330752 } Got keys from plugin meta data ("QSQLITE") QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QMYSQL3", "QMYSQL" ] }, "archreq": 0, "className": "QMYSQLDriverPlugin", "debug": false, "version": 330752 } "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" not a plugin QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QMYSQL3", "QMYSQL" ] }, "archreq": 1, "className": "QMYSQLDriverPlugin", "debug": true, "version": 330752 } Got keys from plugin meta data ("QMYSQL3", "QMYSQL") QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbc.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbc.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QODBC3", "QODBC" ] }, "archreq": 0, "className": "QODBCDriverPlugin", "debug": false, "version": 330752 } "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbc.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" not a plugin QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbcd.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbcd.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QODBC3", "QODBC" ] }, "archreq": 1, "className": "QODBCDriverPlugin", "debug": true, "version": 330752 } Got keys from plugin meta data ("QODBC3", "QODBC") QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsql.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsql.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QPSQL7", "QPSQL" ] }, "archreq": 0, "className": "QPSQLDriverPlugin", "debug": false, "version": 330752 } "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" not a plugin QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsqld.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsqld.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QPSQL7", "QPSQL" ] }, "archreq": 1, "className": "QPSQLDriverPlugin", "debug": true, "version": 330752 } Got keys from plugin meta data ("QPSQL7", "QPSQL") QFactoryLoader::QFactoryLoader() checking directory path "E:/Qt Creator/build-sql_console_test-Desktop_Qt_5_12_1_MinGW_64_bit-Debug/debug/sqldrivers" ... Cannot load library C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found. QLibraryPrivate::loadPlugin failed on "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll" : "Cannot load library C:\\Qt\\Qt5.12.1\\5.12.1\\mingw73_64\\plugins\\sqldrivers\\qsqlmysqld.dll: The specified module could not be found." QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7 Database is Not Connected! -
@SGaist I've called the qmake in debug mode, run the code and again Database is Not Connected!
Then again, I have start the application with the QT_DEBUG_PLUGINS environment variable and I get the next messageQFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers" ... QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlite.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlite.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QSQLITE" ] }, "archreq": 0, "className": "QSQLiteDriverPlugin", "debug": false, "version": 330752 } "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlite.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" not a plugin QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlited.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlited.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QSQLITE" ] }, "archreq": 1, "className": "QSQLiteDriverPlugin", "debug": true, "version": 330752 } Got keys from plugin meta data ("QSQLITE") QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QMYSQL3", "QMYSQL" ] }, "archreq": 0, "className": "QMYSQLDriverPlugin", "debug": false, "version": 330752 } "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" not a plugin QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QMYSQL3", "QMYSQL" ] }, "archreq": 1, "className": "QMYSQLDriverPlugin", "debug": true, "version": 330752 } Got keys from plugin meta data ("QMYSQL3", "QMYSQL") QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbc.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbc.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QODBC3", "QODBC" ] }, "archreq": 0, "className": "QODBCDriverPlugin", "debug": false, "version": 330752 } "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbc.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" not a plugin QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbcd.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlodbcd.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QODBC3", "QODBC" ] }, "archreq": 1, "className": "QODBCDriverPlugin", "debug": true, "version": 330752 } Got keys from plugin meta data ("QODBC3", "QODBC") QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsql.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsql.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QPSQL7", "QPSQL" ] }, "archreq": 0, "className": "QPSQLDriverPlugin", "debug": false, "version": 330752 } "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" not a plugin QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsqld.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlpsqld.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QPSQL7", "QPSQL" ] }, "archreq": 1, "className": "QPSQLDriverPlugin", "debug": true, "version": 330752 } Got keys from plugin meta data ("QPSQL7", "QPSQL") QFactoryLoader::QFactoryLoader() checking directory path "E:/Qt Creator/build-sql_console_test-Desktop_Qt_5_12_1_MinGW_64_bit-Debug/debug/sqldrivers" ... Cannot load library C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found. QLibraryPrivate::loadPlugin failed on "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll" : "Cannot load library C:\\Qt\\Qt5.12.1\\5.12.1\\mingw73_64\\plugins\\sqldrivers\\qsqlmysqld.dll: The specified module could not be found." QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7 Database is Not Connected!wrote on 2 Mar 2019, 09:39 last edited by JonB 3 Feb 2019, 09:41Cannot load library
C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found.Does the exact file specified by that path actually exist, or not? (Note that the file mentioned,
qsqlmysqld.dll, has adjust before the., presumably indicating it's a debug build; this is not the same as if it wereqsqlmysql.dll.) -
Cannot load library
C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found.Does the exact file specified by that path actually exist, or not? (Note that the file mentioned,
qsqlmysqld.dll, has adjust before the., presumably indicating it's a debug build; this is not the same as if it wereqsqlmysql.dll.) -
To reduce the output, can you move out of that folder all .dll files that are not related to MySQL ?
-
To reduce the output, can you move out of that folder all .dll files that are not related to MySQL ?
wrote on 2 Mar 2019, 16:48 last edited by@SGaist I removed the non-MySQL files
Here is the outputQFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers" ... QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QMYSQL3", "QMYSQL" ] }, "archreq": 0, "className": "QMYSQLDriverPlugin", "debug": false, "version": 330752 } "The plugin 'C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" not a plugin QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll" Found metadata in lib C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QMYSQL3", "QMYSQL" ] }, "archreq": 1, "className": "QMYSQLDriverPlugin", "debug": true, "version": 330752 } Got keys from plugin meta data ("QMYSQL3", "QMYSQL") QFactoryLoader::QFactoryLoader() checking directory path "E:/Qt Creator/build-sql_console_test-Desktop_Qt_5_12_1_MinGW_64_bit-Debug/debug/sqldrivers" ... Cannot load library C:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found. QLibraryPrivate::loadPlugin failed on "C:/Qt/Qt5.12.1/5.12.1/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll" : "Cannot load library C:\\Qt\\Qt5.12.1\\5.12.1\\mingw73_64\\plugins\\sqldrivers\\qsqlmysqld.dll: The specified module could not be found." QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QMYSQL QMYSQL3 Database is Not Connected!Same file qsqlmysqld.dll
-
Where exactly are the dlls matching the library you used to build the plugin ?
-
@Stelian said in Error QMYSQL Plugin on Windows:
C:Program Files/MYSQL/MySQL Server 8.0/lib
Then that's the one you should be having in your PATH environment variable.
One other thing you can use is Dependency Walker. Use it on your Qt MySQL plugin. Check that it can find the MySQL dll.
-
@Stelian said in Error QMYSQL Plugin on Windows:
C:Program Files/MYSQL/MySQL Server 8.0/lib
Then that's the one you should be having in your PATH environment variable.
One other thing you can use is Dependency Walker. Use it on your Qt MySQL plugin. Check that it can find the MySQL dll.
-
@SGaist yes, I have that path in my path environment variable.
I have never used Dependency Walker.
What do I have to do ?wrote on 4 Mar 2019, 08:25 last edited by@Stelian
Go to http://www.dependencywalker.com/, read, and download the appropriate for your architecture. You just point it at a.exe, or in this case the.dllyou are having trouble with. Look through its output window, to see whether there is another.dllwhich is required but cannot be found, and report back. -
wrote on 4 Mar 2019, 15:23 last edited by
-
If you close the yellow branches does the MySQL dll appear as good or not ?
-
I meant: close the branches where all these warnings can be seen. Just take care to verify that you're not hiding a bigger issue while doing that.
-
I meant: close the branches where all these warnings can be seen. Just take care to verify that you're not hiding a bigger issue while doing that.
-
@SGaist i got the same issue.
This is my dependency walker screen. LIBMYSQL.DLL looks good but i dont know why i still got this error "QSqlDatabase: QMYSQL driver not loaded".image url)
Hi @Hitek,
This libmysql.dll is a 64 bit library. Are you using a 64 bit or 32 bit Qt version for your program?
Regards
-
And is the library in the correct folder?





