GNU Info

Info Node: (mysql.info)Check

(mysql.info)Check


Next: Repair Prev: Crash recovery Up: Table maintenance
Enter node , (file) or (file)node

How to Check Tables for Errors
..............................

To check a MyISAM table, use the following commands:

`myisamchk tbl_name'
     This finds 99.99% of all errors. What it can't find is corruption
     that involves *ONLY* the data file (which is very unusual). If you
     want to check a table, you should normally run `myisamchk' without
     options or with either the `-s' or `--silent' option.

`myisamchk -m tbl_name'
     This finds 99.999% of all errors. It checks first all index
     entries for errors and then it reads through all rows. It
     calculates a checksum for all keys in the rows and verifies that
     they checksum matches the checksum for the keys in the index tree.

`myisamchk -e tbl_name'
     This does a complete and thorough check of all data (`-e' means
     "extended check"). It does a check-read of every key for each row
     to verify that they indeed point to the correct row.  This may
     take a LONG time on a big table with many keys.  `myisamchk' will
     normally stop after the first error it finds. If you want to
     obtain more information, you can add the `--verbose' (`-v')
     option.  This causes `myisamchk' to keep going, up through a
     maximum of 20 errors.  In normal usage, a simple `myisamchk' (with
     no arguments other than the table name) is sufficient.

`myisamchk -e -i tbl_name'
     Like the previous command, but the `-i' option tells `myisamchk' to
     print some informational statistics, too.


automatically generated by info2www version 1.2.2.9