Auto check and repair the MyISAM tables

The last two days a table of the database which is used by my blog had a crashed MyISAM table, and this prevented my blog to be accessible.

The corresponding log of MySQL server:

[ERROR] /usr/libexec/mysqld: Table './webplay_db/prefix_options' is marked as crashed and should be repaired.

I have no monitoring tool set for my vps yet (it’s on my to do list 😛 , to set nagios) so I realised that my blog is not up when I tried to visit it. That’s  why a less time consuming action to solve this problem (than setting nagios) is to add a script in the crontab,  to check and repair tables . An every hour check is  good enough for this purpose:

/usr/bin/mysqlcheck --all-databases -uroot -ppassword -r

I hope a MyISAM table crash not being the reason for my blog's downtime anymore!

Leave a Reply

Your email address will not be published. Required fields are marked *

Prove me that you are not a robot :) * Time limit is exhausted. Please reload the CAPTCHA.