Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QSqlDatabase: QMYSQL driver not loaded



  • Hi there, I'm trying to use MySQL in my application, but for some reason the driver isn't being loaded. Right underneath that error I also get this: "QSqlDatabase: available drivers: QSQLITE, QMYSQL, QMYSQL3, QODBC, QODBC3, QPSQL, QPSQL7". Obviously it can find the driver, but it can't load it. I have MySQL loaded onto my computer and I'm just trying to connect to a test database. I have my path set to the bin folder where libmysql.dll is, but it still refuses to connect, even though it still builds. If anyone could shed some light on this problem I would be really grateful.

    Thanks!

    P.S: I'm using Windows 8.1 with MinGW 4.8.2 as the compiler


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Can you check what error you get from QSqlDatabase ?



  • I get Driver not loaded


  • Lifetime Qt Champion

    Where did you set the PATH environment variable ?


Log in to reply