Support » Fixing WordPress » Post database crash

  • For the 2nd time in 3 wks., my post database crashed. My host restored the database. But againa, for the 2nd time, the long post I was writing disappeared as soon as I hit the Publish button.

    Can anyone tell me if there’s a log file I can review that will tell me what happened & why? If so, what would be the name of the file? I’m wondering if a plugin might be causing the db failure. For example, I use Related Post plugin and I notice that it has been blamed for such db crashes.

    Is there any plugin available that might save posts in draft form in the event of such a crash? Is there any plugin or anything else that might warn me the database has crashed so that I don’t try to publish a post & lose it?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator James Huff


    You might be able to get some useful data from the server error log.

    More than likely, it’s a plugin causing the problem. Try deactivating all plugins, then publish a similarly long post. If that resolved the issue, reactivate each plugin and publish a long test post individually until you find the cause.

    I tried the server error log & it claims to show the last 300 errors & there is only a single error listed fr a few minutes ago. And the database crash was last night. So I’m afraid that won’t be useful.

    Any other options?

    And a further question asked innocently as I don’t know the technical parameters of this issue well: would there be a way when a user clicks “Publish” for the system to first check the database is intact and if it has crashed to somehow retain the post without erasing it, as happens when I try to save the post in the midst of a crash?

    Moderator James Huff


    The only option left would be to deactivate all plugins, then publish a similarly long post. If that resolves the issue, reactivate each plugin and publish a long test post individually until you find the cause.

    As for checking the database first, nothing at this time exists, but I’m sure that plugin could be written to execute a simple MySQL query to check (and perhaps even repair) the database before publishing.

    With a friend’s help I was actually able to find the server error log & pasted into the linked file below the errors related to the db crash. I wonder if you might be able to take a look at this file & see if anything in partiular jumps out at you that might be a cause of the crash.

    Moderator James Huff


    This appears to be the most recent offending entry:

    [10-Jun-2010 05:03:01] WordPress database error Server shutdown in progress for query SELECT SQL_CALC_FOUND_ROWS wp152_posts.* FROM wp152_posts WHERE 1=1 AND wp152_posts.post_type = 'post' AND (wp152_posts.post_status = 'publish') ORDER BY wp152_posts.post_date DESC LIMIT 0, 8 made by require, wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts

    It’s a fairly basic query. It’s just getting a list of the most recent published posts and ordering them by date descending. This is something that every WordPress blog does in the Posts section of the admin panel. If your database is crashing over this, you may want to consider switching to another hosting provider.

    However, Server shutdown in progress does not necessarily mean that the query caused the shutdown. Your query could have unfortunately been executed during the shutdown. Nonetheless, that is the first entry during that time period. Either the query itself caused the server to shutdown, or the server was shutting down during the query, hence your problem.

    Thanks for going through that & finding something I can bring to the attention of my host, whose service till now has been excellent.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Post database crash’ is closed to new replies.