mysqldump: Error : Table is marked as crashed and should be repaired when dumping table

mysqldump: Error : Table is marked as crashed and should be repaired when dumping table

Usually we will get this error while dumping database .

Solution :-

1) Repair the crashed table

# mysql -u user -p pass

>  use database ;

> REPAIR TABLE `tablename`;

2) Repair the complete database

#  check for errors or which are tables are corrupted or not closed properly

# cd /var/lib/mysql/DATABASE

# myisamchk -s *.MYI

will give the status

# myisamchk -r  *.MYI