Connection to OVH MySQL database
Unsolved
General and Desktop
-
Hello,
I'm trying to connect my app to the OVH database Web Cloud Hosting plans.
Here is a picture of what OVH panel looks like:
in my application's main I wrote this:
int main(int argc, char *argv[]) { QApplication a(argc, argv); QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); db.setHostName("mythictcocclient.mysql.db"); db.setDatabaseName("mythictcocclient"); db.setUserName("mythictcocclient"); db.setPassword("passwordIUseToConnectToPHPmyadmin"); bool ok = db.open(); if (ok == false) { qDebug() << db.lastError().text(); qInfo("Database not opened."); return 84; } else { qInfo("Database is open!"); } MainWindow w; w.show(); return a.exec(); }
but I get this error message:
"Unknown MySQL server host 'mythictcocclient.mysql.db' (0) QMYSQL: Unable to connect"
says that this is an unknown address unless OVH tells me to use this address.
I'm kinda lost, if you can help me please, I will be grateful.
-
Hi,
Are you sure it's not an address to use the database within your OVH installation ?
You should check the OVH documentation to enable access from the outside.