It was time to take backup of mysql database of my server. I run the command mysqldump with some options and found the error, ” mysqldump: Got error: 145: Table ‘./DB/table-name’ is marked as crashed and should be repaired when using LOCK TABLES ”
I have seen this error before but not written on this blog.
To solve this issue, simply repair the table which is causing issue. In error, it is clearly stated with database name and table name.
Login into MySQL Database Server
mysql -u root -p
Go to Database Name of concerned table
After login into MySQL Server.Go to database name which table has issue
Write the below given command on mysql prompt
mysql > use database-name;
Check and Repair the table
Run below given command on mysql prompt to check and repair the table
mysql> check table table-name; mysql> repair table table-name; mysql > exit;
Exit from mysqlserver and try once again taking backup by using mysqldump command.
I hope the issue is solved.