Fix for: “WordPress database error MySQL server has gone away for query…”

Posted by on May 12, 2012 in PHP & MySQL Examples | 366 comments

Below is the fix for error “WordPress database error MySQL server has gone away for query…”.

  1. Edit the file wp-db.php located in wp-includes folder.
  2. Search for this line “$this->set_charset( $this->dbh );” around line 1054.
  3. add in this line $this->set_charset( $this->dbh ); between $this->ready = true; and $this->select( $this->dbname, $this->dbh );

Before editing:

Fix for: WordPress database error MySQL server has gone away for query...

After editing:

Fix for: WordPress database error MySQL server has gone away for query...

The error can found on your WordPress folder and the file is called error_log (if any).

468 ad

366 Comments

  1. When someonе writes an article he/she rеtaіnѕ the thought of a
    user in his/heг brain that how a user can unԁerstand іt.

    So that’s why this article is perfect. Thanks!

  2. Ιt’s hard to come by educated people on this subject, but you seem like you know what you’re
    talkіng about! Τhanks

Leave a Comment