Solved MySQL database
-
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
My working MySQL database has started giving me the above error. I do not understand how the database is not loading the driver as it is plainly in sight.
Anyone have any thoughts on how to correct this? Thanks in advance. -
The solution for the QMYSQL not being loaded was the environment path variable needed to point to the lib folder.
In my case it is C:/MySqlDB/lib -
What OS are you on?
This is a question that has been solved numerous times for different OSs https://www.google.co.uk/search?q="QMYSQL+driver+not+loaded"+site%3Aforum.qt.io
-
Do you have MySQL installed and linked with the mysql lib?
Under windows in most cases the dll for mySQL is not accesible by the application. -
OS is windows;
Here is the connection I am using.
mydb = QSqlDatabase::addDatabase("QMYSQL");
mydb.setHostName("127.0.0.1");
mydb.setDatabaseName("ccs");
mydb.setUserName("ccs");
mydb.setPassword("xxxxxxxxxxx"); set with the real password of course -
@koahnig
The connection has been working for a couple of months already. Just now not connecting. -
-
The solution for the QMYSQL not being loaded was the environment path variable needed to point to the lib folder.
In my case it is C:/MySqlDB/lib