Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Mysql error 2003 - list of subcodes

Options
  • 25-04-2012 3:41am
    #1
    Registered Users Posts: 6,464 ✭✭✭


    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 Posts: 2,426 ✭✭✭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 Posts: 6,464 ✭✭✭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