04 Apr 2008 WordPress Database Error
 |  Category: Tech  | Tags: , ,

My blog was down for the last 2 hours due to a database error that said:

WordPress database error: [MySQL server has gone away]

I had this happen on March 21 too. That time my host restored a database backup and I lost a post or two. I put in a ticket again this time, but while I was waiting I did a search and found this site that had a workaround for that error. I applied the workaround as mentioned in the article and my blog came right back! *whew*

So if you ever get an error like that then you need to get the workaround from Rob’s Notebook. It saved my sanity… it will save yours. It was very, very easy to apply.

Rob also mentions why that happens:

Why This Happens

When someone tries to view one of your Wordpress web pages, the PHP code first opens a connection to the MySQL server. Subsequent queries to the MySQL server rely on the connection remaining open, and do not re-open the connection. If the connection to the server happened to have shut down before a query is made, then Wordpress will display this error.

One reason that the connection may shut down is if it has been idle for “wait_timeout” seconds since the last access to the connection. “wait_timeout” is a system variable in your MySQL server configuration. I have created a tool to allow you to check the value of “wait_timeout”.

You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
4 Responses
  1. Thanks for the great information..
    Dorothy

    Dorothy Stahlnecker’s last blog post..Guest Post, My Children in todays World

    Charlotte Reply:

    You’re welcome! :)

  2. Maggie says:

    How scary! I’m sure glad that hasn’t happened to me, but hopefully I’ll remember your tip and come a-searchin if it does!

    Thanks, Charlotte!

    Maggie’s last blog post..Pinay Scandal

    Charlotte Reply:

    It works… just save the site to your favorites so it’s handy if you need it. :)