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. Error connecting to remote mysql server using host name
Forum Updated to NodeBB v4.3 + New Features

Error connecting to remote mysql server using host name

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 443 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.
  • Z Offline
    Z Offline
    Zetsil
    wrote on last edited by Zetsil
    #1

    I try to connect to a remote MySQL server :

           db = QSqlDatabase::addDatabase("QMYSQL");
           db.setHostName("BUCS276b\\I0001 ");//name of a remote desktop from my internal network
           db.setDatabaseName("Test_DB");
           db.setUserName("usr");
           db.setPassword("test");
    

    But i get :

    QSqlError("2005", "QMYSQL: Unable to connect", "Unknown MySQL server host 'BUCS276b\\I0001' (2)")Connexion FAILED.
    //Aditional info :
    Disponible Drivers  ("QSQLITE", "QMYSQL", "QMYSQL3", "QODBC", "QODBC3", "QPSQL", "QPSQL7")
    Functional drivers(QMYSQL):  true
    number of error:  2005
    database error:  "Unknown MySQL server host 'BUCS276b\\I0001' (2)"
    driver error:  "QMYSQL: Unable to connect"
    type erreur:  1
    

    The server is ok , it works if i connect from microsoft sql server manager with same host name .

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Zetsil said in Error connecting to remote mysql server using host name:

      "BUCS276b\I0001 "

      This is for sure no hostname...

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2
      • Z Offline
        Z Offline
        Zetsil
        wrote on last edited by Zetsil
        #3

        Is not, is the name of a remote desktop(host) from my internal network

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Zetsil said in Error connecting to remote mysql server using host name:

          of a remote desktop(host)

          So please specify the hostname or ip address.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          2

          • Login

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