Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Connection to OVH MySQL database

Connection to OVH MySQL database

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 246 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Markyo
    wrote on last edited by
    #1

    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:
    alt text

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved