Sunday, August 22, 2010

Wordpress MySQL Gone Away Error Solved

My wordpress blog is having a MySQL Database Error like "MySQL  Gone Away" where I was compeled to look for some solution immediately. At first, I really thought that my blog was hacked especially that my other blog hosted in another hosting company was literally hacked where I end up canceling my account.

But this blog of mine is more than a year old and is doing well now in Google page rankings. Losing it is definitely not an option for me. So I tried to search for solution.

What's the symptoms of this error?

There are three reported symptoms of this error:

1. This kind of error will cause your website to display nothing of your posts, categories, tags etc. All you will see is your header, widgets and your sidebars.

2. Sometimes, it will also cause your blog to have MySQL timeouts and loads your pages too long.

3. There are also reports that the CPU usage of your host server will have a spike of usage. This will not be good for shared hosted blogs.

Solving the MySQL Error

Searching around the web, I finally found a solution for this error. Thanks to Rob who originally made a post the work around in and to Matthew Tommasi of who made it clear the differences of the codes of Rob.

I tried to summarized the instructions and this is what I used in my blog. I highly recommend that you visit Rob's original post for complete instructions.

So here's what I did:

1.Log in to your Cpanel
2.Click File Manager> wp-includes> wp-db.php
3.Right click> Edit
4.Copy the following code:

$this->query("set session wait_timeout=600");
5.Paste it:
Inside the “__construct(…)” function – see below in green
And after the closing brace ‘}’ of the “
if (!$this->dbh) {
” statement – see below in blue
Note: Courtesy of

6.Click Save.
7.Log out and close your browser. Then launch it again. This is to refresh the cache of your browser, enabling you to see the changes.
If this works, kindly leave a message below or try to retweet it to help others as well. :) God bless!!!


Post a Comment

Commenting is good, it helps everybody. But SPAMMING is bad, it ANNOYS everybody.


About This Blog

This blog is a portfolio of knowledge about Money Making Online and Blogging. It is full of tutorials and helpful tips on successful blogging and making money online.

To start with, I highly recommend that you read 31 Days To Make A Better Blog.

Our Community

  © Blogger templates The Professional Template by 2008

Back to TOP