Support » Plugin: WP Fastest Cache » Error Establishing Database Connection

  • G-Olly

    (@g-olly)


    Hi there,

    I am receiving this error message and the site displays an error establishing database connection. When I clear the cache this seems to sort it out and the website returns to normal. Please see the error message below:

    ——————————————————————————————————

    Warning: mysql_query(): MySQL server has gone away in …./my-site/wp-includes/wp-db.php on line 1870

    Warning: mysql_query(): Error reading result set’s header in …./my-site/wp-includes/wp-db.php on line 1870

    Warning: Cannot modify header information – headers already sent by (output started at …./my-site/wp-includes/wp-db.php:1870) in …./my-site/wp-includes/functions.php on line 3637

    ———————————————————————————————————–

    Here are the parts that it refers to:

    ——-> indicates lines specified

    wp-includes/wp-db.php:

    private function _do_query( $query ) {
    if ( defined( ‘SAVEQUERIES’ ) && SAVEQUERIES ) {
    $this->timer_start();
    }

    if ( ! empty( $this->dbh ) && $this->use_mysqli ) {
    $this->result = mysqli_query( $this->dbh, $query );
    } elseif ( ! empty( $this->dbh ) ) {
    ——-> $this->result = mysql_query( $query, $this->dbh );
    }
    $this->num_queries++;

    if ( defined( ‘SAVEQUERIES’ ) && SAVEQUERIES ) {
    $this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
    }
    }

    ———————————————————————————————————–

    /wp-includes/functions.php:

    function dead_db() {
    global $wpdb;

    wp_load_translations_early();

    // Load custom DB error template, if present.
    if ( file_exists( WP_CONTENT_DIR . ‘/db-error.php’ ) ) {
    require_once( WP_CONTENT_DIR . ‘/db-error.php’ );
    die();
    }

    // If installing or in the admin, provide the verbose message.
    if ( wp_installing() || defined( ‘WP_ADMIN’ ) )
    wp_die($wpdb->error);

    // Otherwise, be terse.
    status_header( 500 );
    nocache_headers();
    ——-> header( ‘Content-Type: text/html; charset=utf-8’ );
    ?>

    ———————————————————————————————————–

    Can anyone let me know what might be the cause of this? I am no developer so any help would be much appreciated.

    Many thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Emre Vona

    (@emrevona)

    WPFC does not cause such issue. Maybe your db is down sometimes.

    sadeghdota

    (@sadeghdota)

    I had this error too in my site antilicense.com

    Plugin Author Emre Vona

    (@emrevona)

    WPFC does not cause such issue.

    G-Olly

    (@g-olly)

    Indeed, today I received a 522 error on the site. Seems like CloudFlare was not communicating to my site in a timely manner eventually throwing up a 522 error page. For the moment I have disabled CloudFlare to serve directly off the site server and this seems to fixed the current 522 error. Having researched this further it seems like it could just be a firewall not letting the requests through so have asked my hosts to whitelist CFs IPs to see if that fixes the issue. If not then it seems like I will have to see if there is a plugin causing too many requests somewhere.

    Plugin Author Emre Vona

    (@emrevona)

    too many requests? from WPFC?

    G-Olly

    (@g-olly)

    I don’t know, probably not, if it isn’t the IPs issue then I will try and figure out the culprit. I will let you know if it is.

    Plugin Author Emre Vona

    (@emrevona)

    ok.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Error Establishing Database Connection’ is closed to new replies.