MySQL server has gone away – Fix For WordPress Database Error

by on December 5th, 2007

Ever encountered with this WordPress MySQL error? MySQL Server Has Gone Away. And then your blog sidebars will refuse to show posts links, tags, recent posts, recent comments etc. I got this problem over and over again and I thought that I was using heavy plugins and MySQL query was timed out being very long. I searched for some solution but just found this answer that if I will use long query, MySQL server will be timed out and will be gone away. Funny!!! But I was hesitating to use more plugins and actually using limited options and other limits in existing WordPress plugins in my blog.

After a bit googling today I found a final solution for ‘MySQL server has gone away’ problem with my blog. There is a fix of wp-includes/wp-db.php file for this. Different versions of WordPress has different fix file. I am using WP 2.3 so I will give link here for WordPress 2.3 version.

How to Fix MySQL error

To install the fix, download the “fixed” wp-db…phptxt file, rename it to wp-db.php, and copy it to wp-includes/wp-db.php (overwriting the old file). You may want to backup the old file instead of overwriting it. You’ll need to do this each time you upgrade WordPress, with the appropriate version of wp-db.php for that version of WordPress.

To download fix file please follow origional source link.

Origional complete article link with downloadable fixes for all WordPress versions

I have successfully installed the fix and now my blog is problem free. Thanks to Rob’s Notebook for sorting this problem out. 


Share

One Review

  1. latin escorts says:

    I definitely want to read a bit more on this site soon. BTW, rather nice design you have at that blog, but don’t you think it should be changed from time to time?