Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts

    MySQL server has gone away, yet is still running

    I have a script which has a 3 day timeout. The reason being is that it can take some time to complete and also has a point where it sits and waits for user input without doing anything except run through a loop to check AJAX responses. I have found that if it runs for too long and then the "continue" button is clicked I will get the error "MySQL server has gone away" during a critical point. I don't know why this is happening and would like to know why this error #2006 "MySQL server has gone away" is popping up. Anyone have some suggestions?

  • #2
    Regular Coder
    Join Date
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts
    No ideas?

    Oh well, just checking the connection with PHP's mysql_ping() will have to do for now.

  • #3
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    In my opinion this is a really bad design, to have a query wait for user response. Better to separate user response from the query, so the query runs in the background as a CRON job or something, as a result of the user response.

  • #4
    Regular Coder
    Join Date
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts
    You misunderstand. A query isn't waiting on a user response. The entire script is. On occasion the script runs and hits a point in processing that requires adjusting the contents of a file that only a human is capable of doing. The script then continues on its way after being notified that the information it needs to finish up processing has been added to that file. However, part of its normal processing is to look up information in a DB and to add records to the DB.

    For some reason it continues to lose the ability to lookup records after a certain point of waiting for a response. I now have the script ping the database to see if a connection is active. If none is active it re-establishes a connection.

    However, after re-establishing the connection it can't select the database because MySQL kicks up the error #2006 "server has gone away" over and over again each time it runs mysql_select_db(). Why this is I have yet to be able to figure out.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •