Repair MySQL ERROR 144 (HY000)

  • Posted on: 19 August 2014
  • By: Don

If you receive something like this after a MySQL restart:

Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
ERROR 144 (HY000) at line 1: Table './MY_db/MY_table' is marked as # crashed and last (automatic?) repair failed

You can fix it with this (replace MY_db and MY_table):

myisamchk -r /var/lib/mysql/MY_db/MY_table

Then restart MySQL after index fixing:

service mysql restart

Done.

If you try to repair a large MyISAM table with this method, probably you will receive an error like this:

...
myisamchk: error: myisam_sort_buffer_size is too small
MyISAM-table 'table.MYI' is not fixed because of errors

So use for big table fixes the following (replace MY_db, MY_big_table and, if needed, the sort buffer size of 4G):

myisamchk -r -q /var/lib/mysql/MY_db/MY_big_table.MYI --sort_buffer_size=4G

Then restart MySQL after index fixing:

service mysql restart

Tags: