Maybe many people have encountered the class Can 'topenfile: '[Table] mytable. the myi' error message does not know how to solve it. Next we will introduce that, in most cases, database corruption only means that the index file is damaged, the real data is damaged in rare cases. Most forms of database corruption can be easily repaired. And the previous school
Maybe many people have encountered the class Can 'topenfile: '[Table] mytable. the myi' error message does not know how to solve it. Next we will introduce that, in most cases, database corruption only means that the index file is damaged, the real data is damaged in rare cases. Most forms of database corruption can be easily repaired. And the previous school
Many people may have encountered an error message like Can't open file: '[Table] mytable. myi', but do not know how to solve it. Let's introduce it as follows,
In most cases, the database is damaged only when the index file is damaged, and the real data is damaged rarely. Most forms of database corruption can be easily repaired.
As with the previous verification, there are three methods to fix the vulnerability.
The method described below is only valid for tables in MyISAM format. Other types of damages must be recovered from the backup.
1. repair table SQL statement (mysql service must be running ).
2. Command mysqlcheck (mysql service can be running ).
3. Command myisamchk (mysql service must be stopped or the operated table is inactive ).
When repairing a table, you 'd better back up the table first. So you need two times the hard disk space of the original table. Make sure that your disk space is not used up before the restoration.
1. Use the "repair table" method to fix
Syntax: repair table name [Option]
The options are as follows:
QUICK is the fastest speed when the data table has not been modified
EXTENDED attempts to restore each data row will produce some junk data rows.
USE_FRM is used when the. MYI file is lost or the header is damaged. Re-indexing using the definition of. frm
In most cases, you can simply use "repair table tablename" without the option. However, this method does not work when the. MYI file is lost or the header is damaged,
For example:
Mysql> repair table mytable;
When the repair fails, the index file is lost or its header is damaged. To use the relevant definition file for repair, you need to use the USE_FRM option. For example:
Mysql> repair table mytable USE_FRM;
We can see that the output information of the Msg_test table item is "OK", and the table name has successfully repaired the damaged table.
Http://bbs.landingbj.com/t-0-250391-1.html