When the power is down, some innodb tables are broken. phpmyadmin shows that the Table is in use and reports #145-Table '. /shbc/user_order_logs 'is marked as crashed and shoshould be retried red.
The myisam table was damaged once in the past. for details, refer to the repair method for Incorrect key file for table mysql table corruption.
The solution is as follows:
Mysql> select * from user_order_logs;
ERROR 145 (HY000): Table './shbc/user_order_logs' is marked as crashed and shoshould be retried Red
Mysql> check table user_order_logs;
+ ---------------------- + ------- + ---------- + --------------------------------------------------------- +
| Table | Op | Msg_type | Msg_text |
+ ---------------------- + ------- + ---------- + --------------------------------------------------------- +
| Shbc. user_order_logs | check | warning | Table is marked as crashed |
| Shbc. user_order_logs | check | error | Size of datafile is: 1368064 shocould be: 1368188 |
| Shbc. user_order_logs | check | error | UPT |
+ ---------------------- + ------- + ---------- + --------------------------------------------------------- +
3 rows in set (0.01 sec)
Mysql> repair table user_order_logs;
+ ---------------------- + -------- + ---------- + -------------------------------------------------------- +
| Table | Op | Msg_type | Msg_text |
+ ---------------------- + -------- + ---------- + -------------------------------------------------------- +
| Shbc. user_order_logs | repair | info | Found block that points outside data file at 1368024 |
| Shbc. user_order_logs | repair | status | OK |
+ ---------------------- + -------- + ---------- + -------------------------------------------------------- +
2 rows in set (0.17 sec)
If you do not know how to use the command, you can install phpmyadmin and fix it.
In phpmyadmin, select the database table to be optimized, and select repair table in the check box to optimize the data table. The following figure shows a drop-down menu at the bottom of the window, that is, under the list. Select Repair Table (Repair Table)