QMYSQL driver not loaded and Library mysql is not defined
-
@Christian-Ehrlicher thx so much it worked, the command tell me this:
Running configuration tests... Checking for DB2 (IBM)... no Checking for InterBase... no Checking for MySQL... yes Checking for OCI (Oracle)... no Checking for ODBC... yes Checking for PostgreSQL... no Checking for SQLite (version 2)... no Checking for TDS (Sybase)... no Done running configuration tests. Configure summary: Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. yes OCI (Oracle) ........................... no ODBC ................................... yes PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no Qt is now configured for building. Just run 'nmake'. Once everything is built, you must run 'nmake install'. Qt will be installed into 'C:\Qt\5.12.5\msvc2017'. Prior to reconfiguration, make sure you remove any leftovers from the previous build.
So, MySQL is available, I typed nmake, then nmake install, then nmake install in mysql directory, everything seems to work.
I rebuilt my app, and ran the app and get this:
QML debugging is enabled. Only use this in a safe environment. QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
Don't understand why it is available but not loaded.
-
The driver needs the dlls to be loaded.
You can help finding them modifying the PATH environment variable in the Run part of the Project panel in Qt Creator.
-
@SGaist Hello! I'm building a second app using QMySQL database, the first app (the one about this topic) works perfectly as expected, but the second tells me that the driver isn't loaded.
QSqlDatabase: MYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
I added mysql dll dir in PATH environment variable, but same problem stay the same..
Have you an idea please?
EDIT: nevermind, I'm just stupid, I forgot the "Q" before "MYSQL" call in code line:
QSqlDatabase db = QSqlDatabase::addDatabase("MYSQL");
Now it's:
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
and strangely, works better..
Again, thank you all for your help!