Error QMYSQL Plugin on Windows
-
@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
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.dll
you are having trouble with. Look through its output window, to see whether there is another.dll
which is required but cannot be found, and report back. -
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.
-
And is the library in the correct folder?