Hi.
I tried a tipical:
bool MainWindow::connecToDB(){
db.setHostName("http://localhost");
db.setDatabaseName("name");
db.setUserName("user");
db.setPassword("password");
if(!db.open()){
msgBox.setModal(true);
msgBox.setText("Error ...");
msgBox.exec();
return false;
}
return true;
}
bool MainWindow::connecToDB(){
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("http://localhost");
db.setDatabaseName("name");
db.setUserName("user");
db.setPassword("password");
if(!db.open()){
QMessageBox msgBox;
msgBox.setModal(true);
msgBox.setText("Error ...");
msgBox.exec();
return false;
}
return true;
}
To copy to clipboard, switch view to plain text mode
I came to the error:
QSqlDatabase: available drivers
: QSQLITE QSQLITE2 QPSQL7 QPSQL
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QSQLITE2 QPSQL7 QPSQL
To copy to clipboard, switch view to plain text mode
I suppose this has something to do with the license restrictions for driver included in Qt?
I am using Debian/GNU LInux and i installed Qt with this Source Package: qt4-x11 (4.4.3-1).
How do i install the driver?
Thanks
Bookmarks