myisamchk supports the following options for table repair operations (operations performed when an option such as myisamchk支持以下表修复操作选项(当给出--recover
or --safe-recover
is given):--recover
或--safe-recover
等选项时执行的操作):
--backup
, -B
Make a backup of the 将.MYD
file as file_name
-time
.BAK.MYD
文件备份为file_name-time.BAK
。
The directory where character sets are installed. See Section 10.15, “Character Set Configuration”.安装字符集的目录。参阅第10.15节,“字符集配置”。
Correct the checksum information for the table.更正表的校验和信息。
--data-file-length=
, len
-D
len
The maximum length of the data file (when re-creating data file when it is “full”).数据文件的最大长度(当数据文件“已满”时重新创建时)。
--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. Do not use this option unless you are desperate.执行修复,尝试从数据文件中恢复所有可能的行。通常,这也会发现很多垃圾行。除非你绝望,否则不要使用这个选项。
See also the description of this option under table checking options.另请参阅表检查选项下对此选项的描述。
For a description of the output format, see Section 4.6.4.5, “Obtaining Table Information with myisamchk”.有关输出格式的说明,请参阅第4.6.4.5节,“使用myisamchk获取表信息”。
--force
, -f
Overwrite old intermediate files (files with names like 覆盖旧的中间文件(名称如
) instead of aborting.tbl_name
.TMDtbl_name.TMD
的文件),而不是中止。
--keys-used=
, val
-k
val
For myisamchk, the option value is a bit value that indicates which indexes to update. 对于myisamchk,选项值是一个位值,指示要更新哪些索引。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. 选项值的每个二进制位对应一个表索引,其中第一个索引是位0。选项值为0会禁用对所有索引的更新,这可用于获得更快的插入。Deactivated indexes can be reactivated by using myisamchk -r.可以使用myisamchk -r重新激活已停用的索引。
--no-symlinks
, -l
Do not follow symbolic links. Normally myisamchk repairs the table that a symlink points to. 不要遵循符号链接。通常myisamchk会修复符号链接指向的表。This option does not exist as of MySQL 4.0 because versions from 4.0 on do not remove symlinks during repair operations.从MySQL 4.0开始,此选项不存在,因为4.0之后的版本在修复操作期间不会删除符号链接。
Skip rows larger than the given length if myisamchk cannot allocate memory to hold them.如果myisamchk无法分配内存来保存大于给定长度的行,则跳过这些行。
Use the same technique as 使用与-r
and -n
, but create all the keys in parallel, using different threads. This is beta-quality code. Use at your own risk!-r
和-n
相同的技术,但使用不同的线程并行创建所有键。这是beta质量代码。使用风险自负!
--quick
, -q
Achieve a faster repair by modifying only the index file, not the data file. You can specify this option twice to force myisamchk to modify the original data file in case of duplicate keys.通过仅修改索引文件而不是数据文件来实现更快的修复。您可以指定此选项两次,以强制myisamchk在出现重复键的情况下修改原始数据文件。
--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 进行修复,几乎可以解决任何问题,除了不唯一的唯一键(这在MyISAM
tables). If you want to recover a table, this is the option to try first. MyISAM
表中是一个极不可能的错误)。如果要恢复表,可以先尝试以下选项。You should try 只有当myisamchk报告无法使用--safe-recover
only if myisamchk reports that the table cannot be recovered using --recover
. --recover
恢复表时,才应尝试--safe-recover
。(In the unlikely case that (在不太可能的情况下,--recover
fails, the data file remains intact.)--recover
失败,数据文件保持不变。)
If you have lots of memory, you should increase the value of 如果你有很多内存,你应该增加myisam_sort_buffer_size
.myisam_sort_buffer_size
的值。
--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. --recover
慢一个数量级,但可以处理--recover
无法处理的几个非常不可能的情况。This recovery method also uses much less disk space than 这种恢复方法也比--recover
. --recover
使用更少的磁盘空间。Normally, you should repair first using 通常,您应该先使用--recover
, and then with --safe-recover
only if --recover
fails.--recover
进行修复,然后在--recover
失败时使用--safe-recover
进行修复。
If you have lots of memory, you should increase the value of 如果你有很多内存,你应该增加key_buffer_size
.key_buffer_size
的值。
Specify the collation to use for sorting table indexes. The character set name is implied by the first part of the collation name.指定用于对表索引进行排序的排序规则。字符集名称由排序规则名称的第一部分暗示。
--sort-recover
, -n
Force myisamchk to use sorting to resolve the keys even if the temporary files would be very large.强制myisamchk使用排序来解析密钥,即使临时文件非常大。
--tmpdir=
, dir_name
-t
dir_name
The path of the directory to be used for storing temporary files. 用于存储临时文件的目录路径。If this is not set, myisamchk uses the value of the 如果没有设置,myisamchk将使用TMPDIR
environment variable. TMPDIR
环境变量的值。--tmpdir
can be set to a list of directory paths that are used successively in round-robin fashion for creating temporary files. --tmpdir
可以设置为以轮转方式连续使用的目录路径列表,用于创建临时文件。The separator character between directory names is the colon (目录名之间的分隔符在Unix上是冒号(:
) on Unix and the semicolon (;
) on Windows.:
),在Windows上是分号(;
)。
--unpack
, -u
Unpack a table that was packed with myisampack.打开装满myisampack的表。