Table marked as crashed in mysql

If you run a php mysql server you might sometimes get this error:
Table xxxx is marked as crashed
This problem usually happens when your server shuts down improperly due to power failures or some other problems. It’s a very common problem on oscommerce installations and usually happens on the sessions table.
The problem often crashes your website and you must first recover the crashed table before bringing it back online.
To recover the table, simply use this command:
mysqlcheck -r databasename tablename -u admin -p
replacing databasename with your database name and tablename with your crashed table name
Your website should now be back online.
The code has been tested on a linux centos 6 server.
Using -c option instead of -r in the upper code will perdorm a check on the table.

Leave a Reply