Fix SQL error Index for table 'user_db' is corrupted, try to repair it
|I am receiving an SQL error: Index for table 'user_db' is corrupted, try to repair it. I am not sure what went wrong.|
How can I fix this ?
The error "Index for table '' is corrupted, try to repair it" is related to the specific table, which for some reason became corrupted, as mentioned in the notification. This problem can be solved using TABLE REPAIR. You can try to fix it with the first solution and if it will not work, you can try the second one with USE_FRM.
Please note that using of these solutions to repair the table, may cause the data loss under some circumstances. It is recommended to make a backup of a table before performing a table repair operation. I used TABLE REPAIR on localhost, where the data loss may not be so serious.
Regular table repair:
TABLE REPAIR table_name;
Table repair with using USE_FRM:
TABLE REPAIR table_name USE_FRM;
|Is faster one big SQL query or multiple small SQL queries ?|
|Insert or update current date in DATETIME format - SQL|
|Error: You can't specify target table for update in FROM clause|
|Copy and update rows in the same table with autoincrement - SQL|
|Select or count rows with unique values in column in table - SQL|
|Using Update and Left Join in SQL together not working - example|