| The MyISAM table in the MySQL database is the | | | | deleted rows in the data file. Also, it reconstructs the |
| default type of database engine. This table stores the | | | | index file. |
| data in three types of files: .frm file to store the table | | | | - Using Check table/Repair table: You should use the |
| format, .myd file to store the data, and the .myi file to | | | | 'Check Table' tool to check the MyISAM table for |
| store the index file. If any of these three files get | | | | errors using the following syntax: |
| damaged due to any sundry reason such as many | | | | CHECK TABLE tbl_name [, tbl_name] ... [option] ...option |
| users modifying the table simultaneously, virus | | | | = {FOR UPGRADE | QUICK | FAST | MEDIUM | |
| infections, abrupt system shutdown, etc. MySQL | | | | EXTENDED | CHANGED} |
| provides several utilities to recover MySQL tables. | | | | After detecting errors in the table, you should use the |
| However, if these tools do not work for the MySQL | | | | 'Repair Table' tool to repair MySQL table. For this, you |
| table you are using, then you should use a third-party | | | | can use the following syntax: |
| MySQL repair software to repair MySQL database. | | | | REPAIR [NO_WRITE_TO_BINLOG | LOCAL] |
| | | | | TABLEtbl_name [, tbl_name] ... |
| Let us take a practical situation in which you are facing | | | | [QUICK] [EXTENDED] [USE_FRM] |
| the following error message while working on the | | | | |
| MySQL 5.0.4 database table: | | | | Try to reproduce the steps that caused the error |
| | | | | message to be displayed. If the error does not appear, |
| "MySQL error code 126: Index file is crashed" | | | | then the MyISAM table is repaired. However, if the |
| | | | | error appears again then the MySQL table is severely |
| Cause: | | | | damaged. The use of a third-party MySQL repair |
| The most possible cause of this problem is that the | | | | software is the best bet in such cases. The use of |
| MyISAM table has damaged, which is why you are | | | | highly intense and safe scanning algorithms along with |
| unable to access and/or work on the table. | | | | rich user interface results in safe and easy MySQL |
| | | | | recovery. |
| Resolution: | | | | |
| To resolve this problem, you should perform the | | | | In such cases, the best software that I would suggest |
| following methods to recover MySQL table and use it | | | | you is Stellar Phoenix Database Recovery for MySQL, |
| once again: | | | | which repairs MySQL database in MySQL 3.x, 4.x, 5.x, |
| - Using 'myisamchk' utility: You should use the | | | | and 6.x versions. With the ability to repair MySQL files |
| 'myisamchk' command to check and repair the | | | | such as .ibdata, .ibd, .myd, .myi, .frm, etc from both |
| damaged MySQL table by using the following MySQL | | | | InnoDB and MyISAM database engines, this MySQL |
| repair syntax:myisamchk -r | | | | recovery utility is compatible with Windows 7, Vista, |
| This command is used to remove the incorrect and | | | | Server 2003, XP, and 2000. |