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
Qt 6.11 is out! See what's new in the release blog

MYSQL database connection verification

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 809 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.
  • ChrisomaC Offline
    ChrisomaC Offline
    Chrisoma
    wrote on 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
    • lemmelL Offline
      lemmelL Offline
      lemmel
      wrote on 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.
      ChrisomaC 1 Reply Last reply
      1
      • lemmelL lemmel

        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.
        ChrisomaC Offline
        ChrisomaC Offline
        Chrisoma
        wrote on last edited by
        #3

        @lemmel Thanks for your advise.

        1 Reply Last reply
        0

        • Login

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