How do I load qmysql
driver in Qt? I have the following code that produces these results:
(\"QSQLITE\", \"QMYSQL\", \"QMYSQL3\")
QSqlDatabase:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3
The same problem I faced in fedora20 (64-bit) with Qt-5.2.0, and then follow steps:
$ cd /opt/Qt5.2.0/5.2.0/gcc_64/plugins/sqldrivers
$ ls
libqsqlite.so libqsqlmysql.so
Use the command below to check library dependency:
$ ldd libqsqlmysql.so
I find the problem:
libmysqlclient_r.so.16 => not found
It may be the library-dependency problem. so solve this problem:
Linking of the library file:
$ ln -s libmysqlclient_r.so.16.0.0 libmysqlclient_r.so
and again:
$ ln -s libmysqlclient_r.so.16.0.0 libmysqlclient_r.so.16
Now its work for me. All the best