While using Mysql databases, there are certain circumstances where you are unable to access the tables which may be due to table corruption reasons such as virus attack, unexpected system shutdown, errors in Mysql version etc and lead to errors including Mysql error 1146. To get rid of this situation, you need to repair the database and for this Mysql repair tool is the best possible option you can opt for.
Let’s assume a situation where you are making an attempt to start Mysql server but instead of got the following error message on screen:
"Default storage engine is not available."
After getting this error message, you reinstall the server but without removing its associated data directory. After this, Mysql server runs fine but when you try to access any table, another message pops up on screen:
"ERROR 1146 (42S02): Table 'Table_name' doesn't exist."
Cause:
The above situation indicates table corruption which can be due to a number of reasons like virus infection, abrupt system shutdown etc and to fix ERROR 1146 (42S02) you need to resolve the table corruption issues immediately.
Solution:
In order to fix Mysql error 1146, go through the below steps:
- If you have an updated backup then try to restore the table using the same
- In case of inavailability of backup, make use of repair command along with 'Quick' or 'Extended' clause in the following manner:
REPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE
table_name [, table_name] ...
[QUICK] [EXTENDED] [USE_FRM] - But even if the ‘mysql 1146 table doesn’t exist’ error remains, then you have to use Mysql repair tool to perform the task of Mysql restore database in a complete and efficient manner.