a2p
accept
access
acct
addftinfo
addr2line
adjtime
afmtodit
after
aio_cancel
aio_error
aio_read
aio_return
aio_suspend
aio_waitcomplete
aio_write
alias
aliases
alloc
anvil
append
apply
apropos
ar
array
as
asa
asn1parse
at
atq
atrm
attemptckalloc
attemptckrealloc
authlib
authtest
autopoint
awk
b64decode
b64encode
basename
batch
bc
bdes
bell
bg
bgerror
biff
big5
binary
bind
bindkey
bindtags
bindtextdomain
bio
bitmap
blowfish
bn
bootparams
bootptab
bounce
brandelf
break
breaksw
brk
bsdiff
bsdtar
bsnmpd
bspatch
bthost
btsockstat
buffer
builtin
builtins
bunzip2
button
byacc
bzcat
bzegrep
bzfgrep
bzgrep
bzip2
c2ph
c89
c99
ca
cal
calendar
canvas
cap_mkdb
case
cat
catch
catman
cc
cd
cdcontrol
chdir
checkbutton
checknr
chflags
chfn
chgrp
chio
chkey
chmod
chown
chpass
chroot
chsh
ci
ciphers
ckalloc
ckdist
ckfree
ckrealloc
cksum
cleanup
clear
clipboard
clock
clock_getres
clock_gettime
clock_settime
close
cmp
co
col
colcrt
colldef
colors
colrm
column
comm
command
compile_et
complete
compress
concat
config
connect
console
continue
core
courierlogger
couriertcpd
cp
cpan
cpio
cpp
creat
crl
crontab
crunchgen
crunchide
crypt
crypto
csh
csplit
ctags
ctm
ctm_dequeue
ctm_rmail
ctm_smail
cu
cursor
cursors
cut
cvs
date
dbiprof
dbiproxy
dc
dcgettext
dcngettext
dd
dde
default
defer
deliverquota
des
destroy
devfs
df
dgettext
dgst
dh
dhparam
dialog
diff
diff3
dig
dir
dirent
dirname
dirs
discard
disktab
dngettext
do
domainname
done
dprofpp
dsa
dsaparam
dtmfdecode
du
dup
dup2
eaccess
ec
ecdsa
echo
echotc
ecparam
ed
edit
editrc
ee
egrep
elf
elfdump
elif
else
enc
enc2xs
encoding
end
endif
endsw
engine
enigma
entry
env
envsubst
eof
eqn
err
errno
error
errstr
esac
ethers
euc
eui64
eval
event
evp
ex
exec
execve
exit
expand
export
exports
expr
extattr
extattr_delete_fd
extattr_delete_file
extattr_get_fd
extattr_get_file
extattr_set_fd
extattr_set_file
f77
false
famm
famx
fblocked
fbtab
fc
fchdir
fchflags
fchmod
fchown
fcntl
fconfigure
fcopy
fdescfs
fdformat
fdread
fdwrite
fetch
fg
fgrep
fhopen
fhstat
fhstatfs
fi
file
file2c
fileevent
filename
filetest
find
find2perl
finger
flex
flock
flush
fmt
focus
fold
font
fontedit
for
foreach
fork
format
forward
fpathconf
frame
from
fs
fstab
fstat
fstatfs
fsync
ftp
ftpchroot
ftpusers
ftruncate
futimes
g711conv
gb2312
gb18030
gbk
gcc
gcore
gcov
gdb
gencat
gendsa
genrsa
gensnmptree
getconf
getdents
getdirentries
getdtablesize
getegid
geteuid
getfacl
getfh
getfsstat
getgid
getgroups
getitimer
getlogin
getopt
getopts
getpeername
getpgid
getpgrp
getpid
getppid
getpriority
getresgid
getresuid
getrlimit
getrusage
gets
getsid
getsockname
getsockopt
gettext
gettextize
gettimeofday
gettytab
getuid
glob
global
gmake
goto
gperf
gprof
grab
grep
grid
grn
grodvi
groff
groff_font
groff_out
groff_tmac
grog
grolbp
grolj4
grops
grotty
group
groups
gunzip
gzcat
gzexe
gzip
h2ph
h2xs
hash
hashstat
hd
head
help2man
hesinfo
hexdump
history
host
hostname
hosts
hosts_access
hosts_options
hpftodit
http
hup
i386_get_ioperm
i386_get_ldt
i386_set_ioperm
i386_set_ldt
i386_vm86
iconv
id
ident
idprio
if
ifnames253
ifnames259
image
imapd
incr
indent
indxbib
info
infokey
inode
install
instmodsh
interp
intro
introduction
ioctl
ipcrm
ipcs
ipf
ipftest
ipnat
ippool
ipresend
issetugid
jail
jail_attach
jobid
jobs
join
jot
kbdcontrol
kbdmap
kcon
kdestroy
kdump
kenv
kevent
keycap
keylogin
keylogout
keymap
keysyms
kgdb
kill
killall
killpg
kinit
kldfind
kldfirstmod
kldload
kldnext
kldstat
kldsym
kldunload
klist
kpasswd
kqueue
kse
kse_create
kse_exit
kse_release
kse_switchin
kse_thr_interrupt
kse_wakeup
ktrace
label
labelframe
lam
lappend
last
lastcomm
lastlog
lchflags
lchmod
lchown
ld
ldap
ldapadd
ldapcompare
ldapdelete
ldapmodify
ldapmodrdn
ldappasswd
ldapsearch
ldapwhoami
ldd
leave
less
lesskey
lex
lgetfh
lhash
libnetcfg
library
limit
limits
lindex
link
linprocfs
linsert
lint
lio_listio
list
listbox
listen
lj4_font
lkbib
llength
lmtp
ln
load
loadfont
local
locale
locate
lock
lockf
log
logger
login
logins
logname
logout
look
lookbib
lorder
lower
lp
lpq
lpr
lprm
lptest
lrange
lreplace
ls
lsearch
lseek
lset
lsort
lstat
lsvfs
lutimes
lynx
m4
madvise
magic
mail
maildiracl
maildirkw
maildirmake
mailq
mailx
make
makeinfo
makewhatis
man
manpath
master
mc
mcedit
mcview
md2
md4
md5
mdc2
memory
menu
menubar
menubutton
merge
mesg
message
mincore
minherit
minigzip
mkdep
mkdir
mkfifo
mkimapdcert
mklocale
mknod
mkpop3dcert
mkstr
mktemp
mlock
mlockall
mmap
mmroff
modfind
modfnext
modnext
modstat
moduli
more
motd
mount
mprotect
mptable
msdos
msdosfs
msgattrib
msgcat
msgcmp
msgcomm
msgconv
msgen
msgexec
msgfilter
msgfmt
msggrep
msginit
msgmerge
msgs
msgunfmt
msguniq
mskanji
msql2mysql
msync
mt
munlock
munlockall
munmap
mv
myisamchk
myisamlog
myisampack
mysql
mysqlaccess
mysqladmin
mysqlbinlog
mysqlcheck
mysqld
mysqldump
mysqld_multi
mysqld_safe
mysqlhotcopy
mysqlimport
mysqlshow
mysql_config
mysql_fix_privilege_tables
mysql_zap
namespace
nanosleep
nawk
nc
ncal
ncplist
ncplogin
ncplogout
neqn
netconfig
netgroup
netid
netstat
networks
newaliases
newgrp
nex
nfsstat
nfssvc
ngettext
nice
nl
nm
nmount
nohup
nologin
notify
nroff
nseq
nslookup
ntp_adjtime
ntp_gettime
nvi
nview
objcopy
objdump
objformat
ocsp
od
onintr
open
openssl
opieaccess
opieinfo
opiekey
opiekeys
opiepasswd
option
options
oqmgr
pack
package
packagens
pagesize
palette
pam_auth
panedwindow
parray
passwd
paste
patch
pathchk
pathconf
pawd
pax
pbm
pcre
pcreapi
pcrebuild
pcrecallout
pcrecompat
pcrecpp
pcregrep
pcrematching
pcrepartial
pcrepattern
pcreperform
pcreposix
pcreprecompile
pcresample
pcretest
perl
perl56delta
perl58delta
perl561delta
perl570delta
perl571delta
perl572delta
perl573delta
perl581delta
perl582delta
perl583delta
perl584delta
perl585delta
perl586delta
perl587delta
perl588delta
perl5004delta
perl5005delta
perlaix
perlamiga
perlapi
perlapio
perlapollo
perlartistic
perlbeos
perlbook
perlboot
perlbot
perlbs2000
perlbug
perlcall
perlcc
perlce
perlcheat
perlclib
perlcn
perlcompile
perlcygwin
perldata
perldbmfilter
perldebguts
perldebtut
perldebug
perldelta
perldgux
perldiag
perldoc
perldos
perldsc
perlebcdic
perlembed
perlepoc
perlfaq
perlfaq1
perlfaq2
perlfaq3
perlfaq4
perlfaq5
perlfaq6
perlfaq7
perlfaq8
perlfaq9
perlfilter
perlfork
perlform
perlfreebsd
perlfunc
perlglossary
perlgpl
perlguts
perlhack
perlhist
perlhpux
perlhurd
perlintern
perlintro
perliol
perlipc
perlirix
perlivp
perljp
perlko
perllexwarn
perllinux
perllocale
perllol
perlmachten
perlmacos
perlmacosx
perlmint
perlmod
perlmodinstall
perlmodlib
perlmodstyle
perlmpeix
perlnetware
perlnewmod
perlnumber
perlobj
perlop
perlopenbsd
perlopentut
perlos2
perlos390
perlos400
perlothrtut
perlpacktut
perlplan9
perlpod
perlpodspec
perlport
perlqnx
perlre
perlref
perlreftut
perlrequick
perlreref
perlretut
perlrun
perlsec
perlsolaris
perlstyle
perlsub
perlsyn
perlthrtut
perltie
perltoc
perltodo
perltooc
perltoot
perltrap
perltru64
perltw
perlunicode
perluniintro
perlutil
perluts
perlvar
perlvmesa
perlvms
perlvos
perlwin32
perlxs
perlxstut
perror
pfbtops
pftp
pgrep
phones
photo
pic
pickup
piconv
pid
pipe
pkcs7
pkcs8
pkcs12
pkg_add
pkg_check
pkg_create
pkg_delete
pkg_info
pkg_sign
pkg_version
pkill
pl2pm
place
pod2html
pod2latex
pod2man
pod2text
pod2usage
podchecker
podselect
poll
popd
popup
posix_madvise
postalias
postcat
postconf
postdrop
postfix
postkick
postlock
postlog
postmap
postqueue
postsuper
pr
pread
preadv
printcap
printenv
printf
proc
procfs
profil
protocols
prove
proxymap
ps
psed
psroff
pstruct
ptrace
publickey
pushd
puts
pwd
pwrite
pwritev
qmgr
qmqpd
quota
quotactl
radiobutton
raise
rand
ranlib
rcp
rcs
rcsclean
rcsdiff
rcsfile
rcsfreeze
rcsintro
rcsmerge
read
readelf
readlink
readonly
readv
realpath
reboot
recv
recvfrom
recvmsg
red
ree
refer
regexp
registry
regsub
rehash
remote
rename
repeat
replace
req
reset
resolver
resource
return
rev
revoke
rfcomm_sppd
rfork
rhosts
ripemd
ripemd160
rlog
rlogin
rm
rmd160
rmdir
rpc
rpcgen
rs
rsa
rsautl
rsh
rtld
rtprio
rup
ruptime
rusers
rwall
rwho
s2p
safe
sasl
sasldblistusers2
saslpasswd2
sbrk
scache
scale
scan
sched
sched_getparam
sched_getscheduler
sched_get_priority_max
sched_get_priority_min
sched_rr_get_interval
sched_setparam
sched_setscheduler
sched_yield
scon
scp
script
scrollbar
sdiff
sed
seek
select
selection
semctl
semget
semop
send
sendbug
sendfile
sendmail
sendmsg
sendto
services
sess_id
set
setegid
setenv
seteuid
setfacl
setgid
setgroups
setitimer
setlogin
setpgid
setpgrp
setpriority
setregid
setresgid
setresuid
setreuid
setrlimit
setsid
setsockopt
settc
settimeofday
setty
setuid
setvar
sftp
sh
sha
sha1
sha256
shar
shells
shift
shmat
shmctl
shmdt
shmget
showq
shutdown
sigaction
sigaltstack
sigblock
sigmask
sigpause
sigpending
sigprocmask
sigreturn
sigsetmask
sigstack
sigsuspend
sigvec
sigwait
size
slapadd
slapcat
slapd
slapdn
slapindex
slappasswd
slaptest
sleep
slogin
slurpd
smbutil
smime
smtp
smtpd
socket
socketpair
sockstat
soelim
sort
source
spawn
speed
spinbox
spkac
splain
split
squid
squid_ldap_auth
squid_ldap_group
squid_unix_group
sscop
ssh
sshd_config
ssh_config
stab
startslip
stat
statfs
stop
string
strings
strip
stty
su
subst
sum
suspend
swapoff
swapon
switch
symlink
sync
sysarch
syscall
sysconftool
sysconftoolcheck
systat
s_client
s_server
s_time
tabs
tail
talk
tar
tbl
tclsh
tcltest
tclvars
tcopy
tcpdump
tcpslice
tcsh
tee
tell
telltc
telnet
term
termcap
terminfo
test
texindex
texinfo
text
textdomain
tfmtodit
tftp
then
threads
time
tip
tk
tkerror
tkvars
tkwait
tlsmgr
tmac
top
toplevel
touch
tput
tr
trace
trafshow
trap
troff
true
truncate
truss
tset
tsort
tty
ttys
type
tzfile
ui
ul
ulimit
umask
unalias
uname
uncomplete
uncompress
undelete
unexpand
unhash
unifdef
unifdefall
uniq
units
unknown
unlimit
unlink
unmount
unset
unsetenv
until
unvis
update
uplevel
uptime
upvar
usbhidaction
usbhidctl
users
utf8
utimes
utmp
utrace
uudecode
uuencode
uuidgen
vacation
variable
verify
version
vfork
vgrind
vgrindefs
vi
vidcontrol
vidfont
view
virtual
vis
vt220keys
vwait
w
wait
wait3
wait4
waitpid
wall
wc
wget
what
whatis
where
whereis
which
while
who
whoami
whois
window
winfo
wish
wm
write
writev
wtmp
x509
xargs
xgettext
xmlwf
xstr
xsubpp
yacc
yes
ypcat
ypchfn
ypchpass
ypchsh
ypmatch
yppasswd
ypwhich
yyfix
zcat
zcmp
zdiff
zegrep
zfgrep
zforce
zgrep
zmore
znew
_exit
__syscall
 
FreeBSD/Linux/UNIX General Commands Manual
Hypertext Man Pages
myisamchk
 
MYISAMCHK(1)		     MySQL Database System		  MYISAMCHK(1)



NAME
       myisamchk - MyISAM table-maintenance utility isamchk - ISAM
       table-maintenance utility

SYNOPSIS
       myisamchk [options] tbl_name ...

       isamchk [options] tbl_name ...

DESCRIPTION
       The myisamchk utility gets information about your database tables or
       checks, repairs, or optimizes them.  myisamchk works with MyISAM tables
       (tables that have .MYD and .MYI files for storing data and indexes). A
       related utility, isamchk, works with ISAM tables (tables that have .ISD
       and .ISM files for storing data and indexes).

       Invoke myisamchk like this:

       shell> myisamchk [options] tbl_name ...

       The options specify what you want myisamchk to do. They are described
       in the following sections. You can also get a list of options by
       invoking myisamchk --help.

       With no options, myisamchk simply checks your table as the default
       operation. To get more information or to tell myisamchk to take
       corrective action, specify options as described in the following
       discussion.

       tbl_name is the database table you want to check or repair. If you run
       myisamchk somewhere other than in the database directory, you must
       specify the path to the database directory, because myisamchk has no
       idea where the database is located. In fact, myisamchk does not
       actually care whether the files you are working on are located in a
       database directory. You can copy the files that correspond to a
       database table into some other location and perform recovery operations
       on them there.

       You can name several tables on the myisamchk command line if you wish.
       You can also specify a table by naming its index file (the file with
       the .MYI suffix). This allows you to specify all tables in a directory
       by using the pattern *.MYI. For example, if you are in a database
       directory, you can check all the MyISAM tables in that directory like
       this:

       shell> myisamchk *.MYI

       If you are not in the database directory, you can check all the tables
       there by specifying the path to the directory:

       shell> myisamchk /path/to/database_dir/*.MYI

       You can even check all tables in all databases by specifying a wildcard
       with the path to the MySQL data directory:

       shell> myisamchk /path/to/datadir/*/*.MYI

       The recommended way to quickly check all MyISAM and ISAM tables is:

       shell> myisamchk --silent --fast /path/to/datadir/*/*.MYI
       shell> isamchk --silent /path/to/datadir/*/*.ISM

       If you want to check all MyISAM and ISAM tables and repair any that are
       corrupted, you can use the following commands:

       shell> myisamchk --silent --force --fast --update-state \
		 --key_buffer_size=64M --sort_buffer_size=64M \
		 --read_buffer_size=1M --write_buffer_size=1M \
		 /path/to/datadir/*/*.MYI
       shell> isamchk --silent --force --key_buffer_size=64M \
		 --sort_buffer_size=64M --read_buffer_size=1M --write_buffer_size=1M \
		 /path/to/datadir/*/*.ISM

       These commands assume that you have more than 64MB free. For more
       information about memory allocation with myisamchk, see the section
       called "\FBMYISAMCHK\FR MEMORY USAGE".

       You must ensure that no other program is using the tables while you are
       running myisamchk. Otherwise, when you run myisamchk, it may display
       the following error message:

       warning: clients are using or haven't closed the table properly

       This means that you are trying to check a table that has been updated
       by another program (such as the mysqld server) that hasn't yet closed
       the file or that has died without closing the file properly.

       If mysqld is running, you must force it to flush any table
       modifications that are still buffered in memory by using FLUSH TABLES.
       You should then ensure that no one is using the tables while you are
       running myisamchk. The easiest way to avoid this problem is to use
       CHECK TABLE instead of myisamchk to check tables.

MYISAMCHK GENERAL OPTIONS
       The options described in this section can be used for any type of table
       maintenance operation performed by myisamchk. The sections following
       this one describe options that pertain only to specific operations,
       such as table checking or repairing.

       o  --help, -?

	  Display a help message and exit.

       o  --debug=debug_options, -# debug_options

	  Write a debugging log. The debug_options string often is
	  'd:t:o,file_name'.

       o  --silent, -s

	  Silent mode. Write output only when errors occur. You can use -s
	  twice (-ss) to make myisamchk very silent.

       o  --verbose, -v

	  Verbose mode. Print more information about what the program does.
	  This can be used with -d and -e. Use -v multiple times (-vv, -vvv)
	  for even more output.

       o  --version, -V

	  Display version information and exit.

       o  --wait, -w

	  Instead of terminating with an error if the table is locked, wait
	  until the table is unlocked before continuing. Note that if you are
	  running mysqld with external locking disabled, the table can be
	  locked only by another myisamchk command.

       You can also set the following variables by using --var_name=value
       syntax: VariableDefault
       Valuedecode_bits9ft_max_word_lenversion-dependentft_min_word_len4ft_stopword_filebuilt-in
       listkey_buffer_size523264myisam_block_size1024read_buffer_size262136sort_buffer_size2097144sort_key_blocks16stats_methodnulls_unequalwrite_buffer_size262136.PP
       It is also possible to set variables by using
       --set-variable=var_name=value or -O var_name=value syntax. However,
       this syntax is deprecated as of MySQL 4.0.

       The possible myisamchk variables and their default values can be
       examined with myisamchk --help:

       sort_buffer_size is used when the keys are repaired by sorting keys,
       which is the normal case when you use --recover.

       key_buffer_size is used when you are checking the table with
       --extend-check or when the keys are repaired by inserting keys row by
       row into the table (like when doing normal inserts). Repairing through
       the key buffer is used in the following cases:

       o  You use --safe-recover.

       o  The temporary files needed to sort the keys would be more than twice
	  as big as when creating the key file directly. This is often the
	  case when you have large key values for CHAR, VARCHAR, or TEXT
	  columns, because the sort operation needs to store the complete key
	  values as it proceeds. If you have lots of temporary space and you
	  can force myisamchk to repair by sorting, you can use the
	  --sort-recover option.

       Repairing through the key buffer takes much less disk space than using
       sorting, but is also much slower.

       If you want a faster repair, set the key_buffer_size and
       sort_buffer_size variables to about 25% of your available memory. You
       can set both variables to large values, because only one of them is
       used at a time.

       myisam_block_size is the size used for index blocks. It is available as
       of MySQL 4.0.0.

       stats_method influences how NULL values are treated for index
       statistics collection when the --analyze option is given. It acts like
       the myisam_stats_method system variable. For more information, see the
       description of myisam_stats_method in the section called "SERVER SYSTEM
       VARIABLES", and Section 4.7, "MyISAM Index Statistics Collection".
       stats_method was added in MySQL 4.1.15/5.0.14. For older versions, the
       statistics collection method is equivalent to nulls_equal.

       The ft_min_word_len and ft_max_word_len variables are available as of
       MySQL 4.0.0.  ft_stopword_file is available as of MySQL 4.0.19.

       ft_min_word_len and ft_max_word_len indicate the minimum and maximum
       word length for FULLTEXT indexes.  ft_stopword_file names the stopword
       file. These need to be set under the following circumstances.

       If you use myisamchk to perform an operation that modifies table
       indexes (such as repair or analyze), the FULLTEXT indexes are rebuilt
       using the default full-text parameter values for minimum and maximum
       word length and the stopword file unless you specify otherwise. This
       can result in queries failing.

       The problem occurs because these parameters are known only by the
       server. They are not stored in MyISAM index files. To avoid the problem
       if you have modified the minimum or maximum word length or the stopword
       file in the server, specify the same ft_min_word_len, ft_max_word_len,
       and ft_stopword_file values to myisamchk that you use for mysqld. For
       example, if you have set the minimum word length to 3, you can repair a
       table with myisamchk like this:

       shell> myisamchk --recover --ft_min_word_len=3 tbl_name.MYI

       To ensure that myisamchk and the server use the same values for
       full-text parameters, you can place each one in both the [mysqld] and
       [myisamchk] sections of an option file:

       [mysqld]
       ft_min_word_len=3
       [myisamchk]
       ft_min_word_len=3

       An alternative to using myisamchk is to use the REPAIR TABLE, ANALYZE
       TABLE, OPTIMIZE TABLE, or ALTER TABLE. These statements are performed
       by the server, which knows the proper full-text parameter values to
       use.

MYISAMCHK CHECK OPTIONS
       myisamchk supports the following options for table checking operations:

       o  --check, -c

	  Check the table for errors. This is the default operation if you
	  specify no option that selects an operation type explicitly.

       o  --check-only-changed, -C

	  Check only tables that have changed since the last check.

       o  --extend-check, -e

	  Check the table very thoroughly. This is quite slow if the table has
	  many indexes. This option should only be used in extreme cases.
	  Normally, myisamchk or myisamchk --medium-check should be able to
	  determine whether there are any errors in the table.

	  If you are using --extend-check and have plenty of memory, setting
	  the key_buffer_size variable to a large value helps the repair
	  operation run faster.

       o  --fast, -F

	  Check only tables that haven't been closed properly.

       o  --force, -f

	  Do a repair operation automatically if myisamchk finds any errors in
	  the table. The repair type is the same as that specified with the
	  --recover or -r option.

       o  --information, -i

	  Print informational statistics about the table that is checked.

       o  --medium-check, -m

	  Do a check that is faster than an --extend-check operation. This
	  finds only 99.99% of all errors, which should be good enough in most
	  cases.

       o  --read-only, -T

	  Don't mark the table as checked. This is useful if you use myisamchk
	  to check a table that is in use by some other application that does
	  not use locking, such as mysqld when run with external locking
	  disabled.

       o  --update-state, -U

	  Store information in the .MYI file to indicate when the table was
	  checked and whether the table crashed. This should be used to get
	  full benefit of the --check-only-changed option, but you shouldn't
	  use this option if the mysqld server is using the table and you are
	  running it with external locking disabled.

MYISAMCHK REPAIR OPTIONS
       myisamchk supports the following options for table repair operations:

       o  --backup, -B

	  Make a backup of the .MYD file as file_name-time.BAK

       o  --character-sets-dir=path

	  The directory where character sets are installed. See Section 8.1,
	  "The Character Set Used for Data and Sorting".

       o  --correct-checksum

	  Correct the checksum information for the table.

       o  --data-file-length=len, -D len

	  Maximum length of the data file (when re-creating data file when it
	  is "full").

       o  --extend-check, -e

	  Do a repair that tries to recover every possible row from the data
	  file. Normally, this also finds a lot of garbage rows. Don't use
	  this option unless you are totally desperate.

       o  --force, -f

	  Overwrite old intermediate files (files with names like
	  tbl_name.TMD) instead of aborting.

       o  --keys-used=val, -k val

	  For myisamchk, the option value is a bit-value that indicates which
	  indexes to update. Each binary bit of the option value corresponds
	  to a table index, where the first index is bit 0. For isamchk, the
	  option value indicates that only the first val of the table indexes
	  should be updated. In either case, an option value of 0 disables
	  updates to all indexes, which can be used to get faster inserts.
	  Deactivated indexes can be reactivated by using myisamchk -r or
	  (isamchk -r).

       o  --no-symlinks, -l

	  Do not follow symbolic links. Normally myisamchk repairs the table
	  that a symlink points to. This option does not exist as of MySQL 4.0
	  because versions from 4.0 on do not remove symlinks during repair
	  operations.

       o  --parallel-recover, -p

	  Uses the same technique as -r and -n, but creates all the keys in
	  parallel, using different threads. This option was added in MySQL
	  4.0.2.  This is beta-quality code; use at your own risk!.

       o  --quick, -q

	  Achieve a faster repair by not modifying the data file. You can
	  specify this option twice to force myisamchk to modify the original
	  data file in case of duplicate keys.

       o  --recover, -r

	  Do a repair that can fix almost any problem except unique keys that
	  are not unique (which is an extremely unlikely error with
	  ISAM/MyISAM tables). If you want to recover a table, this is the
	  option to try first. You should try --safe-recover only if myisamchk
	  reports that the table cannot be recovered by --recover. (In the
	  unlikely case that --recover fails, the data file remains intact.)

	  If you have lots of memory, you should increase the value of
	  sort_buffer_size.

       o  --safe-recover, -o

	  Do a repair using an old recovery method that reads through all rows
	  in order and updates all index trees based on the rows found. This
	  is an order of magnitude slower than --recover, but can handle a
	  couple of very unlikely cases that --recover cannot. This recovery
	  method also uses much less disk space than --recover. Normally, you
	  should repair first using --recover, and then with --safe-recover
	  only if --recover fails.

	  If you have lots of memory, you should increase the value of
	  key_buffer_size.

       o  --set-character-set=name

	  Change the character set used by the table indexes. This option was
	  replaced by --set-collation in MySQL 4.1.1.

       o  --set-collation=name

	  Specify the collation to use for sorting table indexes. The
	  character set name is implied by the first part of the collation
	  name. This option was added in MySQL 4.1.11.

       o  --sort-recover, -n

	  Force myisamchk to use sorting to resolve the keys even if the
	  temporary files should be very big.

       o  --tmpdir=path, -t path

	  Path of the directory to be used for storing temporary files. If
	  this is not set, myisamchk uses the value of the TMPDIR environment
	  variable. Starting from MySQL 4.1, tmpdir can be set to a list of
	  directory paths that are used successively in round-robin fashion
	  for creating temporary files. The separator character between
	  directory names should be colon (`:') on Unix and semicolon (`;') on
	  Windows, NetWare, and OS/2.

       o  --unpack, -u

	  Unpack a table that was packed with myisampack.

OTHER MYISAMCHK OPTIONS
       myisamchk supports the following options for actions other than table
       checks and repairs:

       o  --analyze, -a

	  Analyze the distribution of key values. This improves join
	  performance by enabling the join optimizer to better choose the
	  order in which to join the tables and which indexes it should use.
	  To obtain information about the key distribution, use a myisamchk
	  --description --verbose tbl_name command or the SHOW INDEX FROM
	  tbl_name statement.

       o  --description, -d

	  Print some descriptive information about the table.

       o  --set-auto-increment[=value], -A[value]

	  Force AUTO_INCREMENT numbering for new records to start at the given
	  value (or higher, if there are existing records with AUTO_INCREMENT
	  values this large). If value is not specified, AUTO_INCREMENT
	  numbers for new records begin with the largest value currently in
	  the table, plus one.

       o  --sort-index, -S

	  Sort the index tree blocks in high-low order. This optimizes seeks
	  and makes table scans that use indexes faster.

       o  --sort-records=N, -R N

	  Sort records according to a particular index. This makes your data
	  much more localized and may speed up range-based SELECT and ORDER BY
	  operations that use this index. (The first time you use this option
	  to sort a table, it may be very slow.) To determine a table's index
	  numbers, use SHOW INDEX, which displays a table's indexes in the
	  same order that myisamchk sees them. Indexes are numbered beginning
	  with 1.

	  If keys are not packed (PACK_KEYS=0)), they have the same length, so
	  when myisamchk sorts and moves records, it just overwrites record
	  offsets in the index. If keys are packed (PACK_KEYS=1), myisamchk
	  must unpack key blocks first, then re-create indexes and pack the
	  key blocks again. (In this case, re-creating indexes is faster than
	  updating offsets for each index.)

MYISAMCHK MEMORY USAGE
       Memory allocation is important when you run myisamchk.  myisamchk uses
       no more memory than its memory-related variables are set to. If you are
       going to use myisamchk on very large tables, you should first decide
       how much memory you want it to use. The default is to use only about
       3MB to perform repairs. By using larger values, you can get myisamchk
       to operate faster. For example, if you have more than 32MB RAM, you
       could use options such as these (in addition to any other options you
       might specify):

       shell> myisamchk --sort_buffer_size=16M --key_buffer_size=16M \
		  --read_buffer_size=1M --write_buffer_size=1M ...

       Using --sort_buffer_size=16M should probably be enough for most cases.

       Be aware that myisamchk uses temporary files in TMPDIR. If TMPDIR
       points to a memory filesystem, you may easily get out of memory errors.
       If this happens, run myisamchk with the --tmpdir=path option to specify
       some directory located on a filesystem that has more space.

       When repairing, myisamchk also needs a lot of disk space:

       o  Double the size of the data file (the original file and a copy).
	  This space is not needed if you do a repair with --quick; in this
	  case, only the index file is re-created.  This space must be
	  available on the same filesystem as the original data file, as the
	  copy is created in the same directory as the original.

       o  Space for the new index file that replaces the old one. The old
	  index file is truncated at the start of the repair operation, so you
	  usually ignore this space. This space must be available on the same
	  filesystem as the original data file.

       o  When using --recover or --sort-recover (but not when using
	  --safe-recover), you need space for a sort buffer. The following
	  formula yields the amount of space required:

	  (largest_key + row_pointer_length) x number_of_rows x 2
	  You can check the length of the keys and the row_pointer_length with
	  myisamchk -dv tbl_name. This space is allocated in the temporary
	  directory (specified by TMPDIR or --tmpdir=path).

       If you have a problem with disk space during repair, you can try
       --safe-recover instead of --recover.

SEE ALSO
       isamchk(1), isamlog(1), msql2mysql(1), myisamlog(1), myisampack(1),
       mysql(1), mysql.server(1), mysql_config(1),
       mysql_fix_privilege_tables(1), mysql_zap(1), mysqlaccess(1),
       mysqladmin(1), mysqlbinlog(1), mysqlcheck(1), mysqld(1),
       mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysqlhotcopy(1),
       mysqlimport(1), mysqlshow(1), pack_isam(1), perror(1), replace(1),
       safe_mysqld(1)

       For more information, please refer to the MySQL Reference Manual, which
       may already be installed locally and which is also available online at
       http://dev.mysql.com/doc/.

AUTHOR
       MySQL AB (http://www.mysql.com/).  This software comes with no
       warranty.



MySQL 4.1			  01/27/2006			  MYISAMCHK(1)
=20482
+1801
(91)