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. MYSQL database connection verification
Forum Updated to NodeBB v4.3 + New Features

MYSQL database connection verification

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 655 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
    Chrisoma
    wrote on 10 Aug 2016, 16:28 last edited by
    #1

    Hello there
    I'm programming in RPi (C++) for an application that uses a MYSQL database.
    This Database it's on another station and connected thru network, I need to verify when the other station is online or not.
    At first I connect with no problem but if the other station its turned off I never know until my application stops responding.

    Any advise... thanks

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lemmel
      wrote on 10 Aug 2016, 17:00 last edited by
      #2

      I already add problem with MySQL's connection and I didn't found a solution with Qt. But I have time before release so I stopped wondering.

      The only ideas I got:

      • using some flags for MySQL: MYSQL_OPT_RECONNECT (see: http://doc.qt.io/qt-5/qsqldatabase.html)
        But it didn't seem to be functionnal (the library never tried to reconnect; used wireshark). For your case some more flags : MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_READ_TIMEOUT, MYSQL_OPT_WRITE_TIMEOUT. Try it, may be functionnal for you.
      • build a new driver; didn't do it as it would be time consuming.
      C 1 Reply Last reply 10 Aug 2016, 20:13
      1
      • L lemmel
        10 Aug 2016, 17:00

        I already add problem with MySQL's connection and I didn't found a solution with Qt. But I have time before release so I stopped wondering.

        The only ideas I got:

        • using some flags for MySQL: MYSQL_OPT_RECONNECT (see: http://doc.qt.io/qt-5/qsqldatabase.html)
          But it didn't seem to be functionnal (the library never tried to reconnect; used wireshark). For your case some more flags : MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_READ_TIMEOUT, MYSQL_OPT_WRITE_TIMEOUT. Try it, may be functionnal for you.
        • build a new driver; didn't do it as it would be time consuming.
        C Offline
        C Offline
        Chrisoma
        wrote on 10 Aug 2016, 20:13 last edited by
        #3

        @lemmel Thanks for your advise.

        1 Reply Last reply
        0

        1/3

        10 Aug 2016, 16:28

        • Login

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