cstr
31st May 2013, 19:10
Hi,
Considering that WAMP is installed, and trying to use the MySQL (from WAMP) with Qt/SQL. The following code lead to an error:
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("localhost");
db.setDatabaseName("mydb");
db.setUserName("root");
db.setPassword("");
bool ok = db.open();
QSqlError error = db.lastError();
The error is "Driver not loaded" .
One solution (http://seppemagiels.com/blog/create-mysql-driver-qt5-windows) is to install another SQL.
Is it possible to solve this without additional installations, so the already installed MySQL could be used?
Thanks for the attention.
Considering that WAMP is installed, and trying to use the MySQL (from WAMP) with Qt/SQL. The following code lead to an error:
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("localhost");
db.setDatabaseName("mydb");
db.setUserName("root");
db.setPassword("");
bool ok = db.open();
QSqlError error = db.lastError();
The error is "Driver not loaded" .
One solution (http://seppemagiels.com/blog/create-mysql-driver-qt5-windows) is to install another SQL.
Is it possible to solve this without additional installations, so the already installed MySQL could be used?
Thanks for the attention.