Support » Installing WordPress » database error: [Can’t open file: ‘wp_comments.MYI’ (errno: 145)]

  • I’ve recently upgraded to 2.0.7, and my site has been running smoothly with Akismet, Bad Behavior, and Worst Offenders as my screen against spam.

    This morning I went to the Dashboard, /wp-admin/index.php, which I *can* access, and at the top are two error messages.

    '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''

    More abbreviated versions of these messages appear in the Latest Activity box. If I click on the link for the number of comments, which is supposed to take me to Akismet’s suspected spam page…

    Akismet has protected your site from 2,726 spam comments.

    … I get a page with the same two error messages, followed by the line:

    You do not have sufficient permissions to access this page.

    Which means I cannot access any of my administrative functions. The tab bar that would be at the top of the Dashboard page is totally missing. The links to other admin functions (/wp-admin/edit-comments.php, edit.php, themes.php, etc.) give *only* the same error messages and

    “You do not have sufficient permissions to access this page.”

    Apparently I have no functional administrative access. HELP!

    My best guess is that one of the many spams that have been hitting my page managed to trigger this glitch. When I last looked, I had a dozen in the Akismet page, none of them in numbers above the default thresholds set by Worst Offenders. I think there are perhaps a dozen more spams, by the count given above, as I think we had just tripped past 2700 on the odometer. (Perhaps there are one or more clogged up in the machinery?)

    I have very little idea of how to proceed in cleaning up this mess. It seems I don’t have administrative access to any page other than the Dashboard. I can’t turn off the plug-ins, for example.

    At the bottom of any particular blog entry, above the Post a Comment part, is the following error message:

    'WordPress database error: [Can't open file: 'wp_comments.MYI' (errno: 145)]
    SELECT * FROM wp_comments WHERE comment_post_ID = '102' AND ( comment_approved = '1' OR ( comment_author = 'Kirk' AND comment_author_email = '' AND comment_approved = '0' ) ) ORDER BY comment_date'

    Using another browser, which is not logged into the blog, the same comments section shows this message:

    'WordPress database error: [Can't open file: 'wp_comments.MYI' (errno: 145)]
    SELECT * FROM wp_comments WHERE comment_post_ID = '102' AND comment_approved = '1' ORDER BY comment_date'

    Submitting a test comment from there gives a whole page of error messages. (I can supply these if anyone wants to see them.) I don’t know how much further damage can be caused by more such testing, but the blog is at

    Thanks in advance for your help. This is the sort of thing where I start to throw up my hands in despair. Your hard work has made my blogging “almost” effortless and a lot of fun, and in times like these I can see how much I take for granted.

Viewing 7 replies - 1 through 7 (of 7 total)
  • A quick search for the ‘errno: 145’ bit in Google shows thats it’s a database corruption issue. I would contact your host and see if you can get them to attempt to repair the table. I would normally suggest that you do it yourself but this may be a sign of something bigger.

    Good luck,

    Well, there are two issues. Cleaning up the mess is one.

    The other issue is whether there’s a bug in the software — a combination of WordPress (2.0.7 and maybe other versions), my plug-ins, and something new the spammers are doing — which has triggered this problem.

    It might happen to others, and if it takes high-level expertise to fix the database corruption, a lot of WordPress blogs might be crippled in the next few days, weeks, or months.

    I’m paying for support from my host, but I’d like a little better idea of what I’m asking for before I turn to them. They have a good rep and this may be where I get my money’s worth from them.

    But still, this may be a problem that will affect others, so I want to give y’all a heads-up.

    Until there’s a permanent fix/upgrade, how should I configure my blog so it doesn’t happen again? And should others be worried?

    I would contact your host first and point out that there’s an issue with corruption of the database. That could be caused due to a number of reasons including those on their end.

    The only problem is your host needs to run a check/repair on your db tables. v 2.0.7 is extremely stable.

    Thanks. Good advice. There could be other causes that I haven’t considered. But the blog was running smoothly until yesterday. I’ll let the host know, and point them to this page, and if we figure it out I’ll come back here to relay what we’ve learned.

    Here’s a page that summarizes the “database corruption” error:

    Other thoughts on whether this might have been triggered by something the spammers threw at the blog would be appreciated, in case that ‘‘is’‘ what’s happening. They’re trying all sorts of hairy things, and a couple of times in the last few weeks they’ve managed to squeeze comments through the cracks into my blog.

    The issue may also be server wide. Not telling your host puts the other clients on your box at risk.

    Tech support (Gary) at the host fixed the database corruption problem. All I heard was keyboard clattering, so I don’t know if it involved a comment, as the error messages suggested. (Mentally, I picture pulling out the bits of a piece of paper that got jammed in the copy machine.)

    He confirmed the thinking here that the problem probably occurred at their end — 1) client disconnect in the middle of a process, and 2) a hardware problem being the first two possibilities that came to his mind.

    I don’t know how “client disconnect” could be a trigger. I don’t remember disconnecting on any of my interactions with the blog. And someone commenting just clicks on the “Submit Comment” button, which is a one-time blip of a signal that I don’t know how could be interrupted…

    So maybe it was a hardware problem (which is good, I suppose, on the list of possibilities…) Databases crash all the time, I’m told. Nice that it doesn’t happen very much with WordPress!

    We’ll watch for repeats. Fingers crossed it won’t happen again. Thanks for your help here.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘database error: [Can’t open file: ‘wp_comments.MYI’ (errno: 145)]’ is closed to new replies.