Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Mysql error 2003 - list of subcodes

  • 25-04-2012 03:41AM
    #1
    Registered Users, Registered Users 2 Posts: 6,475 ✭✭✭


    I've got a series of log messages, over a period of time, along the lines of:
    SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'dbserver.blah.whatever.com' (4)
    

    The number in brackets at the end is different on different errors. I'm assuming this is the specific reason for the connection failure, but I can't find any documentation on it.

    Googling just returns a load of different #2003 errors, with various discussions of what the problem might be, but mostly ignoring that code at the end.

    Any suggestions?


Comments

  • Registered Users, Registered Users 2, Paid Member Posts: 2,427 ✭✭✭ressem


    The number at the end is a mysql flag value defined in the mysql sourcecode file /include/my_sys.h. It's passed back and forth between mysql function calls. Not of much help to you.
    #define MY_NABP 4 /* Error if not all bytes read/writen */
    http://www.koders.com/c/fidEE1719DFAB4C552BF2F5CD2AE2664087B0F0B745.aspx?s=rsa

    The important one is the 2003.
    Defined in errmsg.h
    #define CR_CONN_HOST_ERROR 2003

    http://www.koders.com/c/fidB6DE2B5322FF22EBB344F1635B0D73F53C1ADBC5.aspx?s=rsa

    Which is the text you've already seen.

    From the OP I'm guessing that the connection is working some / most of the time, but this is happening intermittently?


  • Registered Users, Registered Users 2 Posts: 6,475 ✭✭✭MOH


    Great, thanks for that.

    It's been happening intermittently over the last few weeks, then the DB server went offline last night and needed a card replaced, so guess that was a sign of impending doom!


Advertisement