When we use PHPMyAdmin to browse the database, we sometimes find that the Collation items of some MyISAM tables are displayed as "in
Use ", which indicates that the table is damaged. Even if "in
The word "use" cannot indicate that the table is in good condition. It is necessary to be familiar with the check and repair methods.
Statement:
Use the check table statement as follows:
Check table tbl_name [, tbl_name]...
[Option]...
Option = {for upgrade | QUICK | FAST | MEDIUM | EXTENDED |
CHANGED}
The repair table uses the repair table statement as follows:
REPAIR [NO_WRITE_TO_BINLOG | LOCAL]
TABLE
Tbl_name [, tbl_name]...
[QUICK] [EXTENDED]
[USE_FRM]
Run the following command:
To check the repair table, run the myisamchk command:
Myisamchk [options] tbl_name
...
If no parameter is specified, the myisamchk Command performs the check action by default. If you want to repair a table, you can use the-r or-o parameters. You should first use-r for restoration. If not, use-o for restoration. In addition, FLUSH should be used before the fix.
Refresh the cache in TABLES, shut down the database server, or lock all TABLES to be repaired to ensure that no other write operations are performed during the restoration process.
Automatic repair:
In the mysqld section of the my. CNF configuration file, set the MyISAM-Recover parameter. when the service is started, the problematic table can be automatically repaired (depending on the data speed ):
[Mysqld]
MyISAM-recover
[=
Options]
The default, backup, force, and quick parameters can be set to backup, force, and force. You cannot set them to force separately. Otherwise, if the data file is lost, you will not be able to cry.
Try to use the myisamchk command to fix the problem. You cannot use the repair statement to fix the problem (slow). If not, refer to the following link.