PDA

View Full Version : Qt5.2 can find the mysql driver but can not load it



stereoMatching
9th January 2014, 03:50
os : win7
compiler : mingw4.8(come with Qt5.2)
link to : Fedora core release 5, kernel 2.6.15-1.2054_FC5 smp on an i686


db = new QSqlDatabase();
db->addDatabase("QMYSQL");
db->setHostName("localhost");
db->setDatabaseName("myclinic");
db->setUserName("root");
db->setPassword(",trth12");

qDebug() << loader.errorString();
qDebug() << "drivers: "<< QSqlDatabase::drivers();

if (db->open())
qDebug() << "Success!";
else
qDebug() << db->lastError().text();


messages

QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available
drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL 7 “The shared
library was not found.” drivers: (“QSQLITE”, “QMYSQL”, “QMYSQL3”,
“QODBC”, “QODBC3”, “QPSQL”, “QPSQL7”)

“Driver not loaded Driver not loaded”

ChrisW67
9th January 2014, 04:09
The MySQL runtime library is likely to be absent from your Windows system or not available on the standard PATH. The Qt Mysql driver is dependent on it.

stereoMatching
10th January 2014, 05:04
Thanks, I solved the problem.looks like win7 do not come with the dll