Getting the old....
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
I think everything is installed correctly. Any help would be appreciated.
#include <QCoreApplication>
#include <QSqlDatabase>
#include <QDebug>
#include <iostream>
int main(int argc, char *argv[])
{
//QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("127.0.0.1");
db.setDatabaseName("QTTest");
db.setUserName("root");
db.setPassword("BOSS");
bool ok = db.open();
qDebug() << ok;
return a.exec();
}
#include <QCoreApplication>
#include <QSqlDatabase>
#include <QDebug>
#include <iostream>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QSqlDatabase db(QSqlDatabase::addDatabase("QMYSQL3"));
//QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("127.0.0.1");
db.setDatabaseName("QTTest");
db.setUserName("root");
db.setPassword("BOSS");
bool ok = db.open();
qDebug() << ok;
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Thanks!
Bookmarks