Oracle 5.0 Reference Manual page 656

Table of Contents

Advertisement

If you do not know the current table option values, use
For the other errors, you must repair your tables.
that occur.
The repair process involves up to four stages, described here. Before you begin, you should change
location to the database directory and check the permissions of the table files. On Unix, make sure that
they are readable by the user that
you are checking). If it turns out you need to modify files, they must also be writable by you.
This section is for the cases where a table check fails (such as those described in
to Check
Tables for
MyISAM
provides.
The
options used for table maintenance with are described in
myisamchk
— MyISAM Table-Maintenance
memory allocation that may improve performance. See
If you are going to repair a table from the command line, you must first stop the
that when you do
mysqladmin shutdown
a while after
mysqladmin
have been flushed to disk.
Stage 1: Checking your tables
Run
myisamchk *.MYI
to suppress unnecessary information.
If the
server is stopped, you should use the
mysqld
to mark the table as "checked."
You have to repair only those tables for which
proceed to Stage 2.
If you get unexpected errors when checking (such as
crashes, go to Stage 3.
Stage 2: Easy safe repair
First, try
myisamchk -r -q tbl_name (-r -q
repair the index file without touching the data file. If the data file contains everything that it should and
the delete links point at the correct locations within the data file, this should work, and the table is fixed.
Start repairing the next table. Otherwise, use the following procedure:
1. Make a backup of the data file before continuing.
2. Use
myisamchk -r tbl_name (-r
deleted rows from the data file and reconstructs the index file.
3. If the preceding step fails, use
uses an old recovery method that handles a few cases that regular recovery mode does not (but is
slower).
Note
If you want a repair operation to go much faster, you should set the values of
the
about 25% of your available memory when running myisamchk.
If you get unexpected errors when repairing (such as
crashes, go to Stage 3.
How to Repair
runs as (and to you, because you need to access the files
mysqld
Errors"), or you want to use the extended features that
Utility".
myisamchk
on a remote server, the
returns, until all statement-processing has stopped and all index changes
or
myisamchk -e *.MYI
means "recovery mode"). This removes incorrect rows and
myisamchk --safe-recover
[493]
sort_buffer_size
636
Tables
MyISAM
SHOW CREATE
can usually detect and fix most problems
myisamchk
also has variables that you can set to control
Section 4.6.3.6,
mysqld
if you have more time. Use the
--update-state
announces an error. For such tables,
myisamchk
out of memory
means "quick recovery mode"). This attempts to
tbl_name. Safe recovery mode
and
key_buffer_size
out of memory
TABLE.
Section 7.6.2, "How
myisamchk
Section 4.6.3,
"myisamchk
"myisamchk
Memory
server. Note
mysqld
server is still available for
(silent) option
-s
[323]
option to tell
myisamchk
errors), or if
myisamchk
[458]
variables each to
errors), or if
myisamchk
Usage".

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents