[MySQL] is marked as crashed and should be repaired

A website’s articles were not displaying. My best guess was that the database was down. After connecting, the database was accessible, but the articles table could not be opened, with the error:

Table is marked as crashed and should be repaired.

I was startled for a moment. Although I had scheduled backups, could the database really be broken? Or was there a security vulnerability?

  1. Based on the literal meaning, I should repair the table.
    After looking it up, Navicat happens to have this feature, so I tried to repair it.

  2. Error:
    mysql table is marked as crashed and last (automatic?) repair failed

The automatic repair failed.

  1. Prepared to check the server logs
    3.1 MySQL was running. Restarted it – normal, but the articles table still couldn’t be read.
    3.2 Since the table uses the ISAM engine, I tried the method found online:
myisamchk -r /your/table/data/path.MYI

Still failed.
3.3 While about to check the logs, I noticed that the disk where MySQL data was stored had run out of space – 0 bytes remaining.

3.4 Obviously, after cleaning up and moving unnecessary files, I used Navicat to repair the table, and it succeeded on the first try.


It’s been a long time since I wrote a blog post. I need to keep at it.

Licensed under CC BY-NC-SA 4.0