Title: SQL Error: Missing wp_comments Table
Last modified: August 18, 2016

---

# SQL Error: Missing wp_comments Table

 *  Resolved [Gary_Petersen](https://wordpress.org/support/users/gary_petersen/)
 * (@gary_petersen)
 * [20 years ago](https://wordpress.org/support/topic/sql-error-missing-wp_comments-table/)
 * 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?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years ago](https://wordpress.org/support/topic/sql-error-missing-wp_comments-table/#post-388869)
 * 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.
   🙂
 *  Thread Starter [Gary_Petersen](https://wordpress.org/support/users/gary_petersen/)
 * (@gary_petersen)
 * [20 years ago](https://wordpress.org/support/topic/sql-error-missing-wp_comments-table/#post-389107)
 * Not completely Greek! 🙂 I’ll give that a shot and see what happens, after backing
   up again. Thanks.
 *  Thread Starter [Gary_Petersen](https://wordpress.org/support/users/gary_petersen/)
 * (@gary_petersen)
 * [20 years ago](https://wordpress.org/support/topic/sql-error-missing-wp_comments-table/#post-389310)
 * 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.
 *  [yielder](https://wordpress.org/support/users/yielder/)
 * (@yielder)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/sql-error-missing-wp_comments-table/#post-389345)
 * Arrrghhhhh. I managed to delete my comments table. How do I re-create it?
 * Thanks
    Mike
 *  [yielder](https://wordpress.org/support/users/yielder/)
 * (@yielder)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/sql-error-missing-wp_comments-table/#post-389346)
 * 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

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘SQL Error: Missing wp_comments Table’ is closed to new replies.

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [open](https://wordpress.org/support/topic-tag/open/)
 * [table](https://wordpress.org/support/topic-tag/table/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [yielder](https://wordpress.org/support/users/yielder/)
 * Last activity: [19 years, 5 months ago](https://wordpress.org/support/topic/sql-error-missing-wp_comments-table/#post-389346)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
