Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions

QSqlDatabase: QMYSQL driver not loaded after successfully built drivers - WINDOWS



  • hey everyone 3 days fighting with mysql driver i read many postes butn unfortantly all are outdate so i followed qt official documentation and build mysql drivers successfully the prb im facing driver is available but cant load

    windows X64

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

    set QT_DEBUG_PLUGINS to 1

    21:03:40: Starting F:\SmartLab LIS\build-SLLV0-Desktop_Qt_5_12_8_MinGW_64_bit-Debug\debug\SLLV0.exe ...
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/5.12.8/mingw73_64/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/platforms/qdirect2d.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/platforms/qdirect2d.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "direct2d"
            ]
        },
        "archreq": 0,
        "className": "QWindowsDirect2DIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    "The plugin 'C:/Qt/5.12.8/mingw73_64/plugins/platforms/qdirect2d.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/platforms/qdirect2dd.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/platforms/qdirect2dd.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "direct2d"
            ]
        },
        "archreq": 1,
        "className": "QWindowsDirect2DIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("direct2d")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/platforms/qminimal.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/platforms/qminimal.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "archreq": 0,
        "className": "QMinimalIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    "The plugin 'C:/Qt/5.12.8/mingw73_64/plugins/platforms/qminimal.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/platforms/qminimald.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/platforms/qminimald.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "archreq": 1,
        "className": "QMinimalIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/platforms/qoffscreen.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/platforms/qoffscreen.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "archreq": 0,
        "className": "QOffscreenIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    "The plugin 'C:/Qt/5.12.8/mingw73_64/plugins/platforms/qoffscreen.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/platforms/qoffscreend.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/platforms/qoffscreend.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "archreq": 1,
        "className": "QOffscreenIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/platforms/qwindows.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/platforms/qwindows.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "windows"
            ]
        },
        "archreq": 0,
        "className": "QWindowsIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    "The plugin 'C:/Qt/5.12.8/mingw73_64/plugins/platforms/qwindows.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/platforms/qwindowsd.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/platforms/qwindowsd.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "windows"
            ]
        },
        "archreq": 1,
        "className": "QWindowsIntegrationPlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("windows")
    QFactoryLoader::QFactoryLoader() checking directory path "F:/SmartLab LIS/build-SLLV0-Desktop_Qt_5_12_8_MinGW_64_bit-Debug/debug/platforms" ...
    loaded library "C:/Qt/5.12.8/mingw73_64/plugins/platforms/qwindowsd.dll"
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/5.12.8/mingw73_64/plugins/platformthemes" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/platformthemes/qxdgdesktopportal.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/platformthemes/qxdgdesktopportal.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
        "MetaData": {
            "Keys": [
                "xdgdesktopportal",
                "flatpak",
                "snap"
            ]
        },
        "archreq": 0,
        "className": "QXdgDesktopPortalThemePlugin",
        "debug": false,
        "version": 330752
    }
    
    
    "The plugin 'C:/Qt/5.12.8/mingw73_64/plugins/platformthemes/qxdgdesktopportal.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/platformthemes/qxdgdesktopportald.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/platformthemes/qxdgdesktopportald.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
        "MetaData": {
            "Keys": [
                "xdgdesktopportal",
                "flatpak",
                "snap"
            ]
        },
        "archreq": 1,
        "className": "QXdgDesktopPortalThemePlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("xdgdesktopportal", "flatpak", "snap")
    QFactoryLoader::QFactoryLoader() checking directory path "F:/SmartLab LIS/build-SLLV0-Desktop_Qt_5_12_8_MinGW_64_bit-Debug/debug/platformthemes" ...
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/5.12.8/mingw73_64/plugins/styles" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/styles/qwindowsvistastyle.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/styles/qwindowsvistastyle.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QStyleFactoryInterface",
        "MetaData": {
            "Keys": [
                "windowsvista"
            ]
        },
        "archreq": 0,
        "className": "QWindowsVistaStylePlugin",
        "debug": false,
        "version": 330752
    }
    
    
    "The plugin 'C:/Qt/5.12.8/mingw73_64/plugins/styles/qwindowsvistastyle.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/styles/qwindowsvistastyled.dll"
    Found metadata in lib C:/Qt/5.12.8/mingw73_64/plugins/styles/qwindowsvistastyled.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QStyleFactoryInterface",
        "MetaData": {
            "Keys": [
                "windowsvista"
            ]
        },
        "archreq": 1,
        "className": "QWindowsVistaStylePlugin",
        "debug": true,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("windowsvista")
    QFactoryLoader::QFactoryLoader() checking directory path "F:/SmartLab LIS/build-SLLV0-Desktop_Qt_5_12_8_MinGW_64_bit-Debug/debug/styles" ...
    loaded library "C:/Qt/5.12.8/mingw73_64/plugins/styles/qwindowsvistastyled.dll"
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/5.12.8/mingw73_64/plugins/sqldrivers" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.12.8/mingw73_64/plugins/sqldrivers/qsqlite.dll"
    Found metadata in lib C:/Qt/5.12.8/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/5.12.8/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/5.12.8/mingw73_64/plugins/sqldrivers/qsqlited.dll"
    Found metadata in lib C:/Qt/5.12.8/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/5.12.8/mingw73_64/plugins/sqldrivers/qsqlmysql.dll"
    Found metadata in lib C:/Qt/5.12.8/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/5.12.8/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/5.12.8/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll"
    Found metadata in lib C:/Qt/5.12.8/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/5.12.8/mingw73_64/plugins/sqldrivers/qsqlodbc.dll"
    Found metadata in lib C:/Qt/5.12.8/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/5.12.8/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/5.12.8/mingw73_64/plugins/sqldrivers/qsqlodbcd.dll"
    Found metadata in lib C:/Qt/5.12.8/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() checking directory path "F:/SmartLab LIS/build-SLLV0-Desktop_Qt_5_12_8_MinGW_64_bit-Debug/debug/sqldrivers" ...
    Cannot load library C:\Qt\5.12.8\mingw73_64\plugins\sqldrivers\qsqlmysqld.dll: The specified module could not be found.
    QLibraryPrivate::loadPlugin failed on "C:/Qt/5.12.8/mingw73_64/plugins/sqldrivers/qsqlmysqld.dll" : "Cannot load library C:\\Qt\\5.12.8\\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
    db not open
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/5.12.8/mingw73_64/plugins/accessible" ...
    QFactoryLoader::QFactoryLoader() checking directory path "F:/SmartLab LIS/build-SLLV0-Desktop_Qt_5_12_8_MinGW_64_bit-Debug/debug/accessible" ...
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/5.12.8/mingw73_64/plugins/accessiblebridge" ...
    QFactoryLoader::QFactoryLoader() checking directory path "F:/SmartLab LIS/build-SLLV0-Desktop_Qt_5_12_8_MinGW_64_bit-Debug/debug/accessiblebridge" ...
    




  • Should give more info about what IDE etc you are using and what steps you have taken. Did you put your libmysql in your mingw/bin directory? I did not build my drivers, I just download the connector 6xx which comes with prebuilt ones and used them. Also you may have to use the 32bit ones. Ive read some 64s function off the 32s.

    --James


  • Lifetime Qt Champion

    @Mounir said in QSqlDatabase: QMYSQL driver not loaded after successfully built drivers - WINDOWS:

    build mysql drivers successfully

    did you also install them? Do you start your app from QtCreator?


Log in to reply