forked from kunpengcompute/mysql-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
myisamchk.1
2489 lines (2489 loc) · 49.8 KB
/
myisamchk.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'\" t
.\" Title: \fBmyisamchk\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 03/06/2020
.\" Manual: MySQL Database System
.\" Source: MySQL 8.0
.\" Language: English
.\"
.TH "\FBMYISAMCHK\FR" "1" "03/06/2020" "MySQL 8\&.0" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
myisamchk \- MyISAM table\-maintenance utility
.SH "SYNOPSIS"
.HP \w'\fBmyisamchk\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fItbl_name\fR\fR\fB\ \&.\&.\&.\fR\ 'u
\fBmyisamchk [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fItbl_name\fR\fR\fB \&.\&.\&.\fR
.SH "DESCRIPTION"
.PP
The
\fBmyisamchk\fR
utility gets information about your database tables or checks, repairs, or optimizes them\&.
\fBmyisamchk\fR
works with
MyISAM
tables (tables that have
\&.MYD
and
\&.MYI
files for storing data and indexes)\&.
.PP
You can also use the
CHECK TABLE
and
REPAIR TABLE
statements to check and repair
MyISAM
tables\&. See
Section\ \&13.7.3.2, \(lqCHECK TABLE Statement\(rq, and
Section\ \&13.7.3.5, \(lqREPAIR TABLE Statement\(rq\&.
.PP
The use of
\fBmyisamchk\fR
with partitioned tables is not supported\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBCaution\fR
.ps -1
.br
.PP
It is best to make a backup of a table before performing a table repair operation; under some circumstances the operation might cause data loss\&. Possible causes include but are not limited to file system errors\&.
.sp .5v
.RE
.PP
Invoke
\fBmyisamchk\fR
like this:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBmyisamchk [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fItbl_name\fR\fR\fB \&.\&.\&.\fR
.fi
.if n \{\
.RE
.\}
.PP
The
\fIoptions\fR
specify what you want
\fBmyisamchk\fR
to do\&. They are described in the following sections\&. You can also get a list of options by invoking
\fBmyisamchk \-\-help\fR\&.
.PP
With no options,
\fBmyisamchk\fR
simply checks your table as the default operation\&. To get more information or to tell
\fBmyisamchk\fR
to take corrective action, specify options as described in the following discussion\&.
.PP
\fItbl_name\fR
is the database table you want to check or repair\&. If you run
\fBmyisamchk\fR
somewhere other than in the database directory, you must specify the path to the database directory, because
\fBmyisamchk\fR
has no idea where the database is located\&. In fact,
\fBmyisamchk\fR
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\&.
.PP
You can name several tables on the
\fBmyisamchk\fR
command line if you wish\&. You can also specify a table by naming its index file (the file with the
\&.MYI
suffix)\&. This enables 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:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBmyisamchk *\&.MYI\fR
.fi
.if n \{\
.RE
.\}
.PP
If you are not in the database directory, you can check all the tables there by specifying the path to the directory:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBmyisamchk \fR\fB\fI/path/to/database_dir/\fR\fR\fB*\&.MYI\fR
.fi
.if n \{\
.RE
.\}
.PP
You can even check all tables in all databases by specifying a wildcard with the path to the MySQL data directory:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBmyisamchk \fR\fB\fI/path/to/datadir/*/*\fR\fR\fB\&.MYI\fR
.fi
.if n \{\
.RE
.\}
.PP
The recommended way to quickly check all
MyISAM
tables is:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBmyisamchk \-\-silent \-\-fast \fR\fB\fI/path/to/datadir/*/*\fR\fR\fB\&.MYI\fR
.fi
.if n \{\
.RE
.\}
.PP
If you want to check all
MyISAM
tables and repair any that are corrupted, you can use the following command:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBmyisamchk \-\-silent \-\-force \-\-fast \-\-update\-state \e\fR
\fB\-\-key_buffer_size=64M \-\-myisam_sort_buffer_size=64M \e\fR
\fB\-\-read_buffer_size=1M \-\-write_buffer_size=1M \e\fR
\fB\fI/path/to/datadir/*/*\fR\fR\fB\&.MYI\fR
.fi
.if n \{\
.RE
.\}
.PP
This command assumes that you have more than 64MB free\&. For more information about memory allocation with
\fBmyisamchk\fR, see
the section called \(lqMYISAMCHK MEMORY USAGE\(rq\&.
.PP
For additional information about using
\fBmyisamchk\fR, see
Section\ \&7.6, \(lqMyISAM Table Maintenance and Crash Recovery\(rq\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBImportant\fR
.ps -1
.br
.PP
\fIYou must ensure that no other program is using the tables while you are running \fR\fI\fBmyisamchk\fR\fR\&. The most effective means of doing so is to shut down the MySQL server while running
\fBmyisamchk\fR, or to lock all tables that
\fBmyisamchk\fR
is being used on\&.
.PP
Otherwise, when you run
\fBmyisamchk\fR, it may display the following error message:
.sp
.if n \{\
.RS 4
.\}
.nf
warning: clients are using or haven\*(Aqt closed the table properly
.fi
.if n \{\
.RE
.\}
.PP
This means that you are trying to check a table that has been updated by another program (such as the
\fBmysqld\fR
server) that hasn\*(Aqt yet closed the file or that has died without closing the file properly, which can sometimes lead to the corruption of one or more
MyISAM
tables\&.
.PP
If
\fBmysqld\fR
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
\fBmyisamchk\fR
.PP
However, the easiest way to avoid this problem is to use
CHECK TABLE
instead of
\fBmyisamchk\fR
to check tables\&. See
Section\ \&13.7.3.2, \(lqCHECK TABLE Statement\(rq\&.
.sp .5v
.RE
.PP
\fBmyisamchk\fR
supports the following options, which can be specified on the command line or in the
[myisamchk]
group of an option file\&. For information about option files used by MySQL programs, see
Section\ \&4.2.2.2, \(lqUsing Option Files\(rq\&.
.SH "MYISAMCHK GENERAL OPTIONS"
.PP
The options described in this section can be used for any type of table maintenance operation performed by
\fBmyisamchk\fR\&. The sections following this one describe options that pertain only to specific operations, such as table checking or repairing\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-help\fR,
\fB\-?\fR
.sp
Display a help message and exit\&. Options are grouped by type of operation\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-HELP\fR,
\fB\-H\fR
.sp
Display a help message and exit\&. Options are presented in a single list\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-debug=\fR\fB\fIdebug_options\fR\fR,
\fB\-# \fR\fB\fIdebug_options\fR\fR
.sp
Write a debugging log\&. A typical
\fIdebug_options\fR
string is
d:t:o,\fIfile_name\fR\&. The default is
d:t:o,/tmp/myisamchk\&.trace\&.
.sp
This option is available only if MySQL was built using
\fBWITH_DEBUG\fR\&. MySQL release binaries provided by Oracle are
\fInot\fR
built using this option\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
\fIfile_name\fR
is interpreted relative to the current directory if given as a relative path name rather than a full path name\&.
.sp
For additional information about this and other option\-file options, see
Section\ \&4.2.2.3, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
\fIfile_name\fR
is interpreted relative to the current directory if given as a relative path name rather than a full path name\&.
.sp
For additional information about this and other option\-file options, see
Section\ \&4.2.2.3, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
\fIstr\fR\&. For example,
\fBmyisamchk\fR
normally reads the
[myisamchk]
group\&. If the
\fB\-\-defaults\-group\-suffix=_other\fR
option is given,
\fBmyisamchk\fR
also reads the
[myisamchk_other]
group\&.
.sp
For additional information about this and other option\-file options, see
Section\ \&4.2.2.3, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
\fB\-\-no\-defaults\fR
can be used to prevent them from being read\&.
.sp
The exception is that the
\&.mylogin\&.cnf
file, if it exists, is read in all cases\&. This permits passwords to be specified in a safer way than on the command line even when
\fB\-\-no\-defaults\fR
is used\&. (\&.mylogin\&.cnf
is created by the
\fBmysql_config_editor\fR
utility\&. See
\fBmysql_config_editor\fR(1)\&.)
.sp
For additional information about this and other option\-file options, see
Section\ \&4.2.2.3, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp
For additional information about this and other option\-file options, see
Section\ \&4.2.2.3, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-silent\fR,
\fB\-s\fR
.sp
Silent mode\&. Write output only when errors occur\&. You can use
\fB\-s\fR
twice (\fB\-ss\fR) to make
\fBmyisamchk\fR
very silent\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
Verbose mode\&. Print more information about what the program does\&. This can be used with
\fB\-d\fR
and
\fB\-e\fR\&. Use
\fB\-v\fR
multiple times (\fB\-vv\fR,
\fB\-vvv\fR) for even more output\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-version\fR,
\fB\-V\fR
.sp
Display version information and exit\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-wait\fR,
\fB\-w\fR
.sp
Instead of terminating with an error if the table is locked, wait until the table is unlocked before continuing\&. If you are running
\fBmysqld\fR
with external locking disabled, the table can be locked only by another
\fBmyisamchk\fR
command\&.
.RE
.PP
You can also set the following variables by using
\fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR
syntax:
.TS
allbox tab(:);
lB lB.
T{
Variable
T}:T{
Default Value
T}
.T&
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l.
T{
decode_bits
T}:T{
9
T}
T{
ft_max_word_len
T}:T{
version-dependent
T}
T{
ft_min_word_len
T}:T{
4
T}
T{
ft_stopword_file
T}:T{
built-in list
T}
T{
key_buffer_size
T}:T{
523264
T}
T{
myisam_block_size
T}:T{
1024
T}
T{
myisam_sort_key_blocks
T}:T{
16
T}
T{
read_buffer_size
T}:T{
262136
T}
T{
sort_buffer_size
T}:T{
2097144
T}
T{
sort_key_blocks
T}:T{
16
T}
T{
stats_method
T}:T{
nulls_unequal
T}
T{
write_buffer_size
T}:T{
262136
T}
.TE
.sp 1
.PP
The possible
\fBmyisamchk\fR
variables and their default values can be examined with
\fBmyisamchk \-\-help\fR:
.PP
myisam_sort_buffer_size
is used when the keys are repaired by sorting keys, which is the normal case when you use
\fB\-\-recover\fR\&.
sort_buffer_size
is a deprecated synonym for
myisam_sort_buffer_size\&.
.PP
key_buffer_size
is used when you are checking the table with
\fB\-\-extend\-check\fR
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:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
You use
\fB\-\-safe\-recover\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
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
\fBmyisamchk\fR
to repair by sorting, you can use the
\fB\-\-sort\-recover\fR
option\&.
.RE
.PP
Repairing through the key buffer takes much less disk space than using sorting, but is also much slower\&.
.PP
If you want a faster repair, set the
key_buffer_size
and
myisam_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\&.
.PP
myisam_block_size
is the size used for index blocks\&.
.PP
stats_method
influences how
NULL
values are treated for index statistics collection when the
\fB\-\-analyze\fR
option is given\&. It acts like the
myisam_stats_method
system variable\&. For more information, see the description of
myisam_stats_method
in
Section\ \&5.1.8, \(lqServer System Variables\(rq, and
Section\ \&8.3.8, \(lqInnoDB and MyISAM Index Statistics Collection\(rq\&.
.PP
ft_min_word_len
and
ft_max_word_len
indicate the minimum and maximum word length for
FULLTEXT
indexes on
MyISAM
tables\&.
ft_stopword_file
names the stopword file\&. These need to be set under the following circumstances\&.
.PP
If you use
\fBmyisamchk\fR
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\&.
.PP
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
\fBmyisamchk\fR
that you use for
\fBmysqld\fR\&. For example, if you have set the minimum word length to 3, you can repair a table with
\fBmyisamchk\fR
like this:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBmyisamchk \-\-recover \-\-ft_min_word_len=3 \fR\fB\fItbl_name\fR\fR\fB\&.MYI\fR
.fi
.if n \{\
.RE
.\}
.PP
To ensure that
\fBmyisamchk\fR
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:
.sp
.if n \{\
.RS 4
.\}
.nf
[mysqld]
ft_min_word_len=3
[myisamchk]
ft_min_word_len=3
.fi
.if n \{\
.RE
.\}
.PP
An alternative to using
\fBmyisamchk\fR
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\&.
.SH "MYISAMCHK CHECK OPTIONS"
.PP
\fBmyisamchk\fR
supports the following options for table checking operations:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-check\fR,
\fB\-c\fR
.sp
Check the table for errors\&. This is the default operation if you specify no option that selects an operation type explicitly\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-check\-only\-changed\fR,
\fB\-C\fR
.sp
Check only tables that have changed since the last check\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-extend\-check\fR,
\fB\-e\fR
.sp
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,
\fBmyisamchk\fR
or
\fBmyisamchk \-\-medium\-check\fR
should be able to determine whether there are any errors in the table\&.
.sp
If you are using
\fB\-\-extend\-check\fR
and have plenty of memory, setting the
key_buffer_size
variable to a large value helps the repair operation run faster\&.
.sp
See also the description of this option under table repair options\&.
.sp
For a description of the output format, see
the section called \(lqOBTAINING TABLE INFORMATION WITH MYISAMCHK\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-fast\fR,
\fB\-F\fR
.sp
Check only tables that haven\*(Aqt been closed properly\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-force\fR,
\fB\-f\fR
.sp
Do a repair operation automatically if
\fBmyisamchk\fR
finds any errors in the table\&. The repair type is the same as that specified with the
\fB\-\-recover\fR
or
\fB\-r\fR
option\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-information\fR,
\fB\-i\fR
.sp
Print informational statistics about the table that is checked\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-medium\-check\fR,
\fB\-m\fR
.sp
Do a check that is faster than an
\fB\-\-extend\-check\fR
operation\&. This finds only 99\&.99% of all errors, which should be good enough in most cases\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-read\-only\fR,
\fB\-T\fR
.sp
Do not mark the table as checked\&. This is useful if you use
\fBmyisamchk\fR
to check a table that is in use by some other application that does not use locking, such as
\fBmysqld\fR
when run with external locking disabled\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-update\-state\fR,
\fB\-U\fR
.sp
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
\fB\-\-check\-only\-changed\fR
option, but you shouldn\*(Aqt use this option if the
\fBmysqld\fR
server is using the table and you are running it with external locking disabled\&.
.RE
.SH "MYISAMCHK REPAIR OPTIONS"
.PP
\fBmyisamchk\fR
supports the following options for table repair operations (operations performed when an option such as
\fB\-\-recover\fR
or
\fB\-\-safe\-recover\fR
is given):
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-backup\fR,
\fB\-B\fR
.sp
Make a backup of the
\&.MYD
file as
\fIfile_name\fR\-\fItime\fR\&.BAK
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
Section\ \&10.15, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-correct\-checksum\fR
.sp
Correct the checksum information for the table\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-data\-file\-length=\fR\fB\fIlen\fR\fR,
\fB\-D \fR\fB\fIlen\fR\fR
.sp
The maximum length of the data file (when re\-creating data file when it is
\(lqfull\(rq)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-extend\-check\fR,
\fB\-e\fR
.sp
Do a repair that tries to recover every possible row from the data file\&. Normally, this also finds a lot of garbage rows\&. Do not use this option unless you are desperate\&.
.sp
See also the description of this option under table checking options\&.
.sp
For a description of the output format, see
the section called \(lqOBTAINING TABLE INFORMATION WITH MYISAMCHK\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-force\fR,
\fB\-f\fR
.sp
Overwrite old intermediate files (files with names like
\fItbl_name\fR\&.TMD) instead of aborting\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-\-keys\-used=\fR\fB\fIval\fR\fR,
\fB\-k \fR\fB\fIval\fR\fR
.sp
For
\fBmyisamchk\fR, 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\&. 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
\fBmyisamchk \-r\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3