MySQL Error - Table tablename is marked as crashed and should be repaired

If you see the MySQL Error "Table tablename is marked as crashed and should be repaired" you can do the following to repair your databases:

If your server is running cPanel:

service chkservd stop

service mysql stop

cd /var/lib/mysql/

find . -type f | grep -i MYI|xargs myisamchk --fast --force --medium-check --backup --safe-recover --sort-index -O key_buffer=64M -O sort_buffer=64M -O read_buffer=1M -O write_buffer=1M -t /root/

service mysql start

service chkservd start

If your VPS is running Plesk:

service mysqld stop

cd /var/lib/mysql/

find . -type f | grep -i MYI|xargs myisamchk --fast --force --medium-check --backup --safe-recover --sort-index -O key_buffer=64M -O sort_buffer=64M -O read_buffer=1M -O write_buffer=1M -t /root/

service mysqld start

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to use SSH

SSH is a tool used to connect to your server.   This is how 95% of your system is setup.To...

Setting the system date and clock

To set the system clock, use the date command.For Redhat Systems, use the following format: date...

Linux Command Line Cheat Sheet

Moving Around the FilesystemCommands for moving around the filesystem include the following....

What are some basic commands that I need to know to use Linux?

If you are new to shell (SSH), below are some commands to get you started. A full list of shell...

Basic Commands for Services

IPTABLES To check firewall rule set using iptables:iptables -L To Flush/Clear the firewall...