Precautions we take to avoid MySQL table crash
Database repairs can often create additional problems. That’s why always take proactive measures to prevent data loss. These steps include:
- Always take a backup of the customer database.
- Check the free space on the server and the size of the database prior to the actual repair. For example, we refrain from repairing a large database on a shared hosting server with disk space shortage.
“MySQL table has marked as crashed and should be repaired”.
To repair through mysql command-line utility using “repair table my_crashed_table;“.
mysql> use my_database;
mysql> repair table my_crashed_table;
Finally, we check the status of the table once again using the mysql check command:
mysql> check table xxx_xxx_update;
+--------------------------------+-------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+--------------------------------+-------+----------+----------+
| xxx.xxx_update | check | status | OK |
+--------------------------------+-------+----------+----------+
The same can be done via phpmyadmin