PDA

View Full Version : Qt/MySQL(WAMP)



cstr
31st May 2013, 20: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.

Lykurg
31st May 2013, 21:54
One solution (http://seppemagiels.com/blog/create-mysql-driver-qt5-windows) is to install another SQL.No, you can just install the development files.

When using MinGW you have to build the driver yourself. The tutorial looks good at a brief look.