I'm trying to connect to the database with QtCreator as follows:
this->db = QSqlDatabase::addDatabase("QMYSQL");
this->db.setHostName("localhost");
this->db.setDatabaseName("Pessoa");
this->db.setUserName("root");
this->db.setPassword("");
if(this->db.open();
But the application returns:
QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
I already installed qt-mysql
and% pro QT += sql
. What should I do in addition to have a connection?
Note:
Version of Qt = 5.2.1
SO = GNU / Linux Fedora