MySQL Reference Manual for version 4.0.18.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.6.2 Using myisamchk for Table Maintenance and Crash Recovery

Starting with MySQL Version 3.23.13, you can check MyISAM tables with the CHECK TABLE command. See section 13.5.2.3 CHECK TABLE Syntax. You can repair tables with the REPAIR TABLE command. See section 13.5.2.6 REPAIR TABLE Syntax.

To check/repair MyISAM tables (`.MYI' and `.MYD') you should use the myisamchk utility. To check/repair ISAM tables (`.ISM' and `.ISD') you should use the isamchk utility. See section 14. MySQL Table Types.

In the following text we will talk about myisamchk, but everything also applies to the old isamchk.

You can use the myisamchk utility to get information about your database tables, check and repair them, or optimize them. The following sections describe how to invoke myisamchk (including a description of its options), how to set up a table maintenance schedule, and how to use myisamchk to perform its various functions.

You can, in most cases, also use the command OPTIMIZE TABLES to optimize and repair tables, but this is not as fast or reliable (in case of real fatal errors) as myisamchk. On the other hand, OPTIMIZE TABLE is easier to use and you don't have to worry about flushing tables. See section OPTIMIZE TABLE.

Even though the repair in myisamchk is quite secure, it's always a good idea to make a backup before doing a repair (or anything that could make a lot of changes to a table)

5.6.2.1 myisamchk Invocation Syntax  
5.6.2.2 General Options for myisamchk  
5.6.2.3 Check Options for myisamchk  
5.6.2.4 Repair Options for myisamchk  
5.6.2.5 Other Options for myisamchk  
5.6.2.6 myisamchk Memory Usage  
5.6.2.7 Using myisamchk for Crash Recovery  
5.6.2.8 How to Check Tables for Errors  
5.6.2.9 How to Repair Tables  
5.6.2.10 Table Optimization  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by rdg (Feb 25 2004) using texi2html