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.

Like
Recent Comments