• During the last 1-2 months I frequently get “Error establishing database connection” about 4-5 times every day. I use SuperCache and the number of plugins I use is small and never had a problem with them.

    So something has to do with the WordPress perhaps. I went to check the MySQL slow queries log and ALL of the logs are full with about the same thing:

    # Query_time: 1.171499 Lock_time: 0.000167 Rows_sent: 50 Rows_examined: 179433
    SELECT * FROM wp_comments c LEFT JOIN wp_posts p ON c.comment_post_ID = p.ID WHERE p.post_status != ‘trash’ ORDER BY c.comment_date_gmt DESC LIMIT 58950, 50

    Now, what is that? Is this something normal? Or is there a way to fix it? Could this be the cause of the errorI get all the time?

Viewing 12 replies - 1 through 12 (of 12 total)
  • You might try running an optimize and repair on your database using a plugin or phpmyadmin.

    Thread Starter chgeorge

    (@chgeorge)

    I’ve optimized it about 5-6 times last month, but the results stay the same.

    How many posts/pages do you have? Cleaning out old post/page revisions can greatly reduce the size of your database and increase it’s speed. Also, empty your trash and delete spam comments.

    Run as SQL query in phpmyadmin to delete post/page revisions. Backup your DB first.

    DELETE a,b,c
    FROM wp_posts a
    LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
    LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
    WHERE a.post_type = 'revision'

    You can add to wp-config.php to stop revisions and autosave:

    define ('WP_POST_REVISIONS', FALSE);
    define('AUTOSAVE_INTERVAL', 6000);

    Or select the number of revisions to keep:
    define('WP_POST_REVISIONS', 3);

    Thread Starter chgeorge

    (@chgeorge)

    I got 925 posts and 5 pages. Trash and Spam are always empty. I just checked that wassup plugin uses over than 2.5 million records. Could this be the problem? I deleted both the plugin and the table, I ‘ll tell you if this is going to work!

    Thread Starter chgeorge

    (@chgeorge)

    Well nothing happened, CPU throttling increases like devil (as traffic increases)… ??

    I’d Clean Options ? WordPress Plugins and be sure the wassup plugin is really gone.

    Thread Starter chgeorge

    (@chgeorge)

    Checked that wassup is fully gone, but same things again. CPU throttling goes like hell. And “error establishing database connection” appears 3-4 times every day, when there is much traffic. Any other idea? ??

    “error establishing database connection” is the host database server going down. Who is your host? Might be better of finding another one.

    Thread Starter chgeorge

    (@chgeorge)

    It’s hostmonster. Moving to another server costs money and time. And the result is not guaranteed…

    having the same problem of cpu throttling about all the day 24hours. from hostmonster

    done several things but no results.

    HAve a hostmonster account as well with the same random error.
    More often than not. Have to refresh many times before it shows.

    throttling of the server maybe?

    Has anyone resolved this with hostmonster aka bluehost yet?

    PLEASE RESPOND IF YOU HAVE!
    thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘MySQL slow queries log’ is closed to new replies.