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. Which database driver should I choose to connect to GearHost Server

Which database driver should I choose to connect to GearHost Server

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 841 Views 1 Watching
  • 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.
  • C Offline
    C Offline
    CroCo
    wrote on last edited by
    #1

    I would like to connect to database hosted by gearhost.com. The database has been designed using MySQL language. In my mac, I haven't installed MySQL however, the driver for the Qt is installed. My question is is installing MySQL necessary? How can I design an application where the users of the application should not worry about installing extra driver in order to use the application? At this moment, running the following script

        qDebug()  <<  QSqlDatabase::drivers();
        QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
        db.setHostName("den1.mysql3.gear.host");
        db.setDatabaseName("xxxxxx"); //<-- I have the real data
        db.setUserName("xxxxxx"); //<-- I have the real data
        db.setPassword("xxxxxx"); //<-- I have the real data
        bool ok = db.open();
        qDebug() << ok;
    

    The output is

    ("QSQLITE", "QMYSQL", "QMYSQL3", "QODBC", "QODBC3", "QPSQL", "QPSQL7")
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
    false
    

    Choosing QSQLITE, the connection is always true even if I turn off the Internet connection. Obviously, there is something incorrect.

    K 1 Reply Last reply
    0
    • C CroCo

      I would like to connect to database hosted by gearhost.com. The database has been designed using MySQL language. In my mac, I haven't installed MySQL however, the driver for the Qt is installed. My question is is installing MySQL necessary? How can I design an application where the users of the application should not worry about installing extra driver in order to use the application? At this moment, running the following script

          qDebug()  <<  QSqlDatabase::drivers();
          QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
          db.setHostName("den1.mysql3.gear.host");
          db.setDatabaseName("xxxxxx"); //<-- I have the real data
          db.setUserName("xxxxxx"); //<-- I have the real data
          db.setPassword("xxxxxx"); //<-- I have the real data
          bool ok = db.open();
          qDebug() << ok;
      

      The output is

      ("QSQLITE", "QMYSQL", "QMYSQL3", "QODBC", "QODBC3", "QPSQL", "QPSQL7")
      QSqlDatabase: QMYSQL driver not loaded
      QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
      false
      

      Choosing QSQLITE, the connection is always true even if I turn off the Internet connection. Obviously, there is something incorrect.

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @CroCo

      Under windows you need a dll which you have to get separately from MySql webpage. For windows these are 2 libraries (the lib-stumpand the dll) to be correct.
      IIRC you can compile, link and run your application without, but you cannot connect.

      Hope this helps.

      Vote the answer(s) that helped you to solve your issue(s)

      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