Title: wp_comments sql error
Last modified: August 18, 2016

---

# wp_comments sql error

 *  [shiznaught](https://wordpress.org/support/users/shiznaught/)
 * (@shiznaught)
 * [18 years, 12 months ago](https://wordpress.org/support/topic/wp_comments-sql-error/)
 * This is the error I get in the admin section of my blog:
 * WordPress database error: [Can’t find file: ‘wp_comments.MYI’ (errno: 2)]
    SELECT
   COUNT(*) FROM wp_comments WHERE comment_approved = ‘0’
 * WordPress database error: [Can’t find file: ‘wp_comments.MYI’ (errno: 2)]
    SELECT
   COUNT(comment_ID) FROM wp_comments WHERE comment_approved = ‘spam’
 * I believe this happened after I deleted all of the comment spam. Now I get the
   error, and all my comments are gone. I do have a back up of the database.
 * Thanks for any suggestions. (wordpress 2.0.4)

Viewing 1 replies (of 1 total)

 *  [dogratcom](https://wordpress.org/support/users/dogratcom/)
 * (@dogratcom)
 * [18 years, 12 months ago](https://wordpress.org/support/topic/wp_comments-sql-error/#post-576833)
 * I feel your pain! I had the same problem hit a week ago with 2.0.5. ([http://www.dograt.com](http://www.dograt.com))
   Error number 2 can’t be repaired, because the table file is g-o-n-e! The comments
   are, I think, still there, because the posts show the comment counts, but without
   the table they’re not available.
 * I’m tempted to trying running upgrade.php to see if it can re-create wp_comments.
   MYI, but my assumption is it won’t work and, if anything, will further screw 
   things up.
 * I have a backup, but it’s not terribly recent. I’d rather look into phpMyAdmin
   to re-creating the table from the comments, or try upgrade.php.
 * If I take the restore route, I’ll need just the comments, as everything else 
   seems to be all right. Obviously, I need more experience with this level of WordPress/
   mySQL, but it would be helpful if somebody with more knowledge could help guide
   the way.
 * Thanks…

Viewing 1 replies (of 1 total)

The topic ‘wp_comments sql error’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [dogratcom](https://wordpress.org/support/users/dogratcom/)
 * Last activity: [18 years, 12 months ago](https://wordpress.org/support/topic/wp_comments-sql-error/#post-576833)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
