Categories

Archives

MySQL Table Repair

Few days ago I got this nasty error from MySQL for one of my Piwik’s tables:

SQLSTATE[HY000]: General error: 145 Table './piwik/log_link_visit_action' is marked as crashed and should be repaired

It was the first time that I dealt with this type of situation, and thought mention the fixing procedure here for those facing similar issue.

Basically any corrupted MySQL table can be fixed using this procedure.

One cause of this error is the disk hitting 100%, so use df and du -sk / to try and figure out where your clogs are.

Now using the mysql> prompt and run the following:

check table <table_name>;

This will show you the error message.

Now go back to the Linux command prompt and issue the following command:

myisamchk -r /var/lib/mysql/<database_name>/<table_name>.MYI

This will, in most cases, will fix the corrupted table, and you’ll be back on the track.

Other posts related to this topic

  • No Related Post

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam protection by WP Captcha-Free