Repair Corrupted MySQL Table
Due to several reason, your MySQL tables can crash. MySQL commands "check table" and "repair table" can help you to check and fix your corrupted MySQL table.
Check Table
You can use "check table" command to check status of MySQL table.
server24# mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 240761 to server version: 4.1.18
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> check table freebb.netfree_sessions;
+-------------------------+-------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+-------------------------+-------+----------+----------+
| freebb.netfree_sessions | check | status | OK |
+-------------------------+-------+----------+----------+
1 row in set (1.53 sec)
mysql>
Repair Table
If a table is corrupted, you can repair it with "repair table command"
server24# mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 241060 to server version: 4.1.18
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> repair table freebb.netfree_sessions;
+-------------------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+-------------------------+--------+----------+----------+
| freebb.netfree_sessions | repair | status | OK |
+-------------------------+--------+----------+----------+
1 row in set (0.06 sec)
mysql>
In above examples, freebb is the database name, netfree_sessions is the table name.
|