PDA

View Full Version : QMYSQL driver not loaded



Erlkönig
1st December 2016, 15:13
Hello,

I am currently developing a simple app that requires interaction with a MySQL database. I already installed MySQL and the x32 C++ Connector. Tried copying its libraries into the project folder, copied the sqldrivers folder from Qt plugins, installed the x64 C++ Connector and copied the libraries again. Still, I receive the one error to rule them all:

"QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7"

Do you have any insight as to why this happens?
I am programming on Windows 7 x64. The examples that came with Qt are running fine, but they all use SQLite, which I can't use.

Thanks in advance!

anda_skoa
2nd December 2016, 08:54
When the driver is listed but cannot be loaded it usually means that a dependency of the driver plugin is not found at runtime.

I.e. Qt finds the plugin, hence it being listed, but it cannot load it.

Most common cause is a missing mysql client library compatible to the one qsqmysql was compile against.

You write that you copied the C++ connector, but did you copy the base mysql client library?

Cheers,
_