myisamchk for Table Maintenance and Crash Recovery
myisamchk Invocation Syntax
myisamchk
myisamchk
myisamchk
myisamchk Memory Usage
myisamchk for Crash Recovery
The following options are used if you start myisamchk with
-r or -o:
-D # or --data-file-length=#
-e or --extend-check
-f or --force
table_name.TMD) instead of aborting.
-k # or keys-used=#
# indexes. If you are using MyISAM, tells which keys
to use, where each binary bit stands for one key (first key is bit 0).
This can be used to get faster inserts! Deactivated indexes can be
reactivated by using myisamchk -r. keys.
-l or --no-symlinks
myisamchk repairs the
table a symlink points at. This option doesn't exist in MySQL 4.0,
as MySQL 4.0 will not remove symlinks during repair.
-r or --recover
-r, you
should then try -o. (Note that in the unlikely case that -r
fails, the datafile is still intact.)
If you have lots of memory, you should increase the size of
sort_buffer_size!
-o or --safe-recover
-r, but can handle a couple of very unlikely cases that
-r cannot handle. This recovery method also uses much less disk
space than -r. Normally one should always first repair with
-r, and only if this fails use -o.
If you have lots of memory, you should increase the size of
key_buffer_size!
-n or --sort-recover
myisamchk to use sorting to resolve the keys even if the
temporary files should be very big.
--character-sets-dir=...
--set-character-set=name
-t or --tmpdir=path
myisamchk will
use the environment variable TMPDIR for this.
Starting from MySQL 4.1, tmpdir can be set to a list of paths
separated by colon : (semicolon ; on Windows). They
will be used in round-robin fashion.
-q or --quick
-q to force myisamchk to modify the original datafile in case
of duplicate keys
-u or --unpack