WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] WordPress data error MySQL server has gone away for query (7 posts)

  1. dionsis
    Member
    Posted 1 year ago #

    The below are two example entries of the logs I'm getting in Apache.

    I have latest wordpress with Apache / PHP / MySQL and Varnish in front of it. I have W3 Total Cache working on the server with CDN too.

    It seems mostly when logged in the site is crawling, but if I switch to incognito chrome, it loads lightning fast.
    I get Varnish 503 errors saying the server is not available but again in incognito the server is loading and pages loading extremely quickly.

    I've tried disabling all plugins and reinstalling them all. I've reconfigured Apache, MySQL and PHP multiple times trying to get optimal settings. However each time it seems to come back to WordPress doing something weird. Everything else looks optimal for my server, even my host says everything on the network and services look spot on.

    I've tried adding
    $this->query("set session wait_timeout=600" );

    As per other forum post suggestions. Has anyone dealt with this problem. It's persistent and disabling plugins didn't resolve it. Even the queries look like general WP queries

    [Tue Jun 11 11:45:45 2013] [error] [client 127.0.0.1] WordPress database error MySQL server has gone away for query SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (776) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/zenko-test/404.php'), get_sidebar, locate_template, load_template, require_once('/themes/zenko-test/sidebar.php'), dynamic_sidebar, call_user_func_array, WP_Widget->display_callback, wpzoom_widget_category_sidebar->widget, WP_Query->__construct, WP_Query->query, WP_Query->get_posts, W3_Db->query, W3_DbCache->query, W3_DbCallUnderlying->query, W3_Db->query, W3_DbProcessor->query, W3_Db->default_query

    [Tue Jun 11 11:45:45 2013] [error] [client 127.0.0.1] WordPress database error MySQL server has gone away for query SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (6128) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/zenko-test/404.php'), get_sidebar, locate_template, load_template, require_once('/themes/zenko-test/sidebar.php'), dynamic_sidebar, call_user_func_array, WP_Widget->display_callback, wpzoom_widget_category_sidebar->widget, WP_Query->__construct, WP_Query->query, WP_Query->get_posts, W3_Db->query, W3_DbCache->query, W3_DbCallUnderlying->query, W3_Db->query, W3_DbProcessor->query, W3_Db->default_query

  2. Frederick Townes
    Member
    Posted 1 year ago #

    Can you submit a bug submission form from the support tab of the plugin please?

  3. dionsis
    Member
    Posted 1 year ago #

    To WordPress or W3TC?

    If I'm not mistaken you're the W3 author? Do you think this is a W3 problem?

  4. dionsis
    Member
    Posted 1 year ago #

    Also recently in the MySQL log this has been coming up.

    Have been attempting to MySQL repair and optimise, but they just happen again and again

    130612 10:25:15 [ERROR] /usr/sbin/mysqld: Table './goldenplec/wp_posts' is marked as crashed and should be repaired
    130612 10:25:15 [Warning] Checking table: './goldenplec/wp_posts'
    130612 10:25:17 [ERROR] /usr/sbin/mysqld: Table './goldenplec/wp_postmeta' is marked as crashed and should be repaired
    130612 10:25:17 [Warning] Checking table: './goldenplec/wp_postmeta'
    130612 10:25:18 [ERROR] /usr/sbin/mysqld: Table './goldenplec/wp_term_relationships' is marked as crashed and should be repaired
    130612 10:25:18 [Warning] Checking table: './goldenplec/wp_term_relationships'
    130612 10:25:18 [ERROR] /usr/sbin/mysqld: Table './goldenplec/wp_options' is marked as crashed and should be repaired
    130612 10:25:18 [Warning] Checking table: './goldenplec/wp_options'

  5. dionsis
    Member
    Posted 1 year ago #

    I don't want to get ahead of myself as it might not be entirely fixed but I haven't seen the error in a while now so thinking I might have gotten it.

    After a lot of server maintenance doing nothing and my hosting company giving up on figuring it out. The solution seems to have been to disabled database caching in W3.

    I'm not sure why, because I've been using database caching on W3 Total cache for nearly 2 years now, but it seems this is the cause.

  6. peshkarkiran
    Member
    Posted 1 year ago #

    HI all,

    I am facing same issue from many days..

    I have my site hosted on amazon with ec2 instance and a mysql rds as my database. from error logs i can say there are so many connections and mysql server gone away..
    i read on many blogs to solve the problem you need to add

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

    I tried that too... but it cant help..

    what will be the solution for the problem?

    Please help..
    thanks in advance..

  7. Danielkktay
    Member
    Posted 11 months ago #

    Has anyone for a way to solve this WordPress bug? Our website has been down for 3 days and we can log in it see how to solve this. We tried adding a code like this forum
    suggest but still failed to load up the web page

    http://Www.trinitybidding.com is blank!

Topic Closed

This topic has been closed to new replies.

About this Topic