Trying to create connection, but always see this message
Ca't create TCP/IP socket (10093): QMYSQL unable to connect
Os: WinXP, Qt 4.1, compiler VC.net
set all availible parameters in sql example file:
db.setHostName("localhost");
db.setDatabaseName("qt");
db.setUserName("root");
db.setPassword("xxw22332");
db.setPort(3306);
if (!db.open()) {
QMessageBox::critical(0, qApp
->tr
("Cannot open database"),
return false;
}
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("localhost");
db.setDatabaseName("qt");
db.setUserName("root");
db.setPassword("xxw22332");
db.setPort(3306);
if (!db.open()) {
QMessageBox::critical(0, qApp->tr("Cannot open database"),
db.lastError().text(), QMessageBox::Cancel,
QMessageBox::NoButton);
return false;
}
To copy to clipboard, switch view to plain text mode
connection parameters right.
Try to build mysql plugin from source...
But error everytime.
Bookmarks