WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] SQL Error: Missing wp_comments Table (6 posts)

  1. Gary_Petersen
    Member
    Posted 8 years ago #

    One one of my WordPress 2.02 weblogs in which I have comments disabled and have made no changes other than posting articles for weeks, I started getting these two error messages at the top of the admin pages when I log in:

    WordPress database error: [Can't open file: 'wp_comments.MYI' (errno: 145)]
    SELECT COUNT(*) FROM wp_comments WHERE comment_approved = '0'

    WordPress database error: [Can't open file: 'wp_comments.MYI' (errno: 145)]
    SELECT COUNT(comment_ID) FROM wp_comments WHERE comment_approved = 'spam'

    If I go into MySQL and click on the wp_comments database table, I get a similar error:

    #1016 - Can't open file: 'wp_comments.MYI' (errno: 145)

    That table from the database is gone. Or at least it appears to be. I've not found anything similar here by searching the forums or codex.

    I can post just fine, but this error message has been consistent for the last few days. I've not yet tried to restore the database from a backup. Any thoughts on what this might be?

  2. Chris_K
    Member
    Posted 8 years ago #

    Errno: 145 indicates that MySQL is unhappy about one of the underlying files used to store data in the database. Oftentimes, you can fix this up by doing a "repair table" yourself.

    However, if the above paragraph reads like greek, contact your host's tech support. :-)

  3. Gary_Petersen
    Member
    Posted 8 years ago #

    Not completely Greek! :-) I'll give that a shot and see what happens, after backing up again. Thanks.

  4. Gary_Petersen
    Member
    Posted 8 years ago #

    It turns out that I didn't have access to the database in a way that I could repair the table, as suggested. Since comments weren't allowed on this weblog (announce only), that table was pretty much empty any way, so I deleted the table that was missing then re-created it manually, using another of my weblog tables as a template.

    All is well now. Thanks for the help.

  5. yielder
    Member
    Posted 7 years ago #

    Arrrghhhhh. I managed to delete my comments table. How do I re-create it?

    Thanks
    Mike

  6. yielder
    Member
    Posted 7 years ago #

    I solved my problem by setting up a new blog. Then I exported the comments table. Then I imported the comments table into the old blog. Then I removed all traces of the new blog.

    Nothing better than being able to solve problems by yourself.

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic