Searching for something ?

Chetan
  • home
  • About
  • Contact
  • Categories »
    • Blogging
    • Images
    • Internet
    • Mobile
    • My Computer
    • Personal
    • Programming
    • Throughout
  • Archives »
    • August 2011
    • April 2011
    • February 2011
    • November 2010
    • October 2010
    • September 2010
    • March 2010
    • February 2010
    • January 2010
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • May 2008
    • April 2008
    • March 2008
    • Archive Page
  • WP-Plugins »
    • WP-CopyProtect
    • Smooth Scroll
  • Add to Google

Blogging

WordPress database error MySQL server has gone away for query in WordPress 2.7

13.12.08 | 9 Responses
ADS BY GOOGLE

ico_wp_databaseRecently i optimize my WordPress for performance with many tweaks like deleting useless tables from database. Installed WP-Super cache, etc.
I was checking the error_log file in my Filemanager i was shocked due to its size, it was 14MB large !. I download it and opened it, all the errors were related to Database.
Almost all lines were starting with
“WordPress database error MySQL server has gone away for query…..”
and few were like this
“WordPress database error Lost connection to MySQL server during query for query…..”

As per the Error statement, the error clearly notifies that the connection between the WordPress and MySQL database was not proper. I just searched Google and seen many results, then i got the idea that its a General problem for many wordpress users.

Rob given a solution for this problem with few patched files to be replaced, You can read his article “Workaround for WordPress database error“. The article give detailed information about this problem. He also given files to be replaced to solve this problem.

According to him, This error is cause due to improper coordination between database and WordPress PHP commands.

According to Rob ,

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.

So for that you need to change the value of “wait_timeout” variable, either ask your site hosting admin to do it for your else you can do it by your self by tweaking your wordpress file named wp-db.php.

Rob given replacement files for WordPress upto version 2.6.1 but recently WordPress 2.7 is released so how to do the patch for WordPress 2.7 ?

Here i am including the file to be replaced by original “wp-db.php” file for WordPress 2.7.

Original wp-db.php
Workaround wp-db.php

Make sure you Backup your database and other files.

In above Workaround file, i just added

$this->query("set session wait_timeout=600");

in line number 334 in original file.

So do Check your Error log file today, else this may cause increase in your site loading time.

  • Share this:
  • Email

Ads by Google

Possibly similar posts

  • TheChetan.com shifted their servers to hostgator :)
  • How to install WordPress locally on Windows PC to test.
  • Comment pages in WordPress 2.7 and SEO.

9 Comments

  • Nihar said:
    Dec 16, 2008 at 2:53 pm

    I have encountered this. i WILL TRY THIS SOLUTION OUT.

    Reply to this comment

  • Salwa said:
    Dec 22, 2008 at 6:16 pm

    I have never encountered this before but thanks for the information. It is always good to “know”

    Reply to this comment

  • cwxwwwxwwxwx said:
    Dec 24, 2008 at 1:07 am

    well, hi admin adn people nice forum indeed. how’s life? hope it’s introduce branch ;)

    Reply to this comment

  • Tom Aquinas said:
    Jan 5, 2009 at 5:54 am

    Thanks for the help!

    Reply to this comment

  • Slim0123 said:
    Feb 8, 2009 at 12:00 pm

    But why would a query take that much time??
    I don’t think this happens except for the case that you are installing something new(it took longer only when I tried to install 60 plugins at the same time)
    There must be something else taking time (may be some backup plugin or something like that).

    Reply to this comment

  • PiterKokoniz said:
    Apr 8, 2009 at 8:42 am

    Hi !! ;)
    My name is Piter Kokoniz. oOnly want to tell, that I’v found your blog very interesting
    And want to ask you: what was the reasson for you to start this blog?
    Sorry for my bad english:)
    Thank you:)
    Your Piter Kokoniz, from Latvia

    Reply to this comment

  • Vikas said:
    Aug 11, 2009 at 10:55 am

    I had changed the wp-db.php file but the same error occurs when i reply to any post,

    If you have any solution regarding this please send.

    Thanks in advance

    Reply to this comment

  • bJones said:
    Jul 9, 2010 at 8:55 pm

    Or you could just set the variable in your my.cnf file on your database setup. This would make it so the solution would good even when you upgrade. Why make it harder then it is….

    Reply to this comment

Trackbacks

  • • TheChetan.com shifted there servers to hostgator | TheChetan.com

speak up

Add your comment below,

Be nice. Keep it clean. Stay on topic. No spam.

* Required Fields

 

Cancel

  • « Mumbai Terrorist Attack – Now whats the future of TAJ and Oberai ?
  • » Hit George Bush with shoe – The Flash Game

Subscribe for updates

Subscribe to RSS Feeds RSS updated or Subscribe via E-mail.

You can also subscribe for SMS Updatessms updated (Powered by Google)

recent posts

  • Installing Hindi, Marathi devanagari Unicode Fonts on Android mobile.
  • HTTPS / SSL – What is it ? Why it’s so Important ?
  • Mozilla Firefox 4 Launch party – Nagpur – India
  • MTV Roadies – The truth ! (Fake, Scripted, etc etc)
  • Sound Beyond Size – X-Mini Capsule Speakers review.
  • Ways to check BSNL Broadband (Dataone) internet usage
  • Rajinikanth jokes on Java – A programmer in Rajini.
  • Twitter updates

  • Be in touch.

    twitter Orkut facebook LinkedIn
  • Google Connect

  • Ranks

    Google Pagerank 6

    Subscribe

  • Ads

  • Tags

    Airtel Best Browser blogging Broadband Browser BSNL Dataone do follow Download Firefox Free Freebie Free DVD Gmail Google hacks Images India Internet Internet Explorer Linux Microsoft Mobile Mozilla My Computer Nagpur Nokia OpenSource Pagerank Programming Security SEO Server SMS Sony Ericsson speed Stickers Sun Tricks and Tips Ubuntu uTorrent Webmaster Windows wordpress world
  • Recent Comments

    • manish jain on Installing Hindi, Marathi devanagari Unicode Fonts on Android mobile.
    • sanjay mishra on [26/11] Mumbai Terrorists attacks in pictures
    • Amit on Installing Hindi, Marathi devanagari Unicode Fonts on Android mobile.
Back to Top ↑
Creative Commons License All trademarks mentioned on this page are the property of their respective owners.Content distributed under CC Licenses Attribution-SA 2.5.
Please read Privacy Policy and Disclaimer. Powered by Wordpress and hosted at HostGator. You can contact me for any communication.
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.