Now, take an example where you are creating a MySQL database that saved at its default location MyISAM. But, All of sudden there occur a error message that is following.
“MySQL error code 145 = Table was marked as crashed and should be repaired.”
The error may arise when we tried to access data’s from corrupted tables. To fix this error you should use proper tools.
Mostly, this error can be easily solved using database repair utilities, but first of all we should check the integrity of the database. For that, you have to follow the following steps.
First check that server is running on which table is stored.
Run the following command for check table consistency:
Where, table_name refers to the name of table to be checked
If the table is reported as corrupt, repair it using the below command:
myisamchk -r -q table_name
This is a quick recovery modet to repair only the indexes of table. If this doesn't work, execute the below command.
myisamchk -r table_name
This command will delete the affected rows that make the table useless. Though, it is necessary to create backup of your database to repair MySQL database. For safe MySQL database recovery, you need to additional utilities that can secure to your database to repair corrupted database.
Stellar Phoenix Database Recovery for MySQL is a tool that is used for repair MySQL database. This harmless tool can be used for both MyISAM and InnoDB database file repair.