Qsqldatabase: qmysql driver not loaded
Qsqldatabase: available drivers: qsqlite
Solution: Check whether libqsqlmysql. So has been installed.
[Test1 @ localhost ~] $ Locate libqsqlmysql. So
/Var/Cache/abrt-DI/usr/lib/debug/usr/lib/qt4/plugins/sqldrivers/libqsqlmysql. So. Debug
I have not installed it on my system. Install the qt-mysql.i686 below.
[Root @ localhost test1] # Yum install qt-mysql.i686
========================================================== ==========================================================
Package arch version repository size
========================================================== ==========================================================
Installing:
Qt-MySQL i686. 7.4-7. fc14 updates 67 K
[Root @ localhost test1] # updatedb
[Test1 @ localhost ~] $ Locate libqsqlmysql. So
/Usr/lib/qt4/plugins/sqldrivers/libqsqlmysql. So
/Var/Cache/abrt-DI/usr/lib/debug/usr/lib/qt4/plugins/sqldrivers/libqsqlmysql. So. Debug
Call in the program
Qdebug () <qcoreapplication: librarypaths ();
You can see the path of the QT Search Library. No/usr/lib/qt4/plugins/
There are two ways to solve this problem:
1. Add the path of libqsqlmysql. So to the library path:
Qcoreapplication: addlibrarypath ("/usr/lib/qt4/plugins /");
2. Directly copy libqsqlmysql. So to the search path of QT.
[Test1 @ localhost ~] $ CP/usr/lib/qt4/plugins/sqldrivers/libqsqlmysql. So qtsdk/desktop/QT/4.8.1/GCC/plugins/sqldrivers/
Http://doc.qt.nokia.com/4.7-snapshot/sql-driver.html