Database Reference
In-Depth Information
Figure 13.9
Checking tables.
The last row for each table name should always be a status message reading OK. If it does
not then there may be some problems with the table, and so you should run a REPAIR
TABLE to try and remedy this fault.
REPAIR TABLE
As we have just explained, after running a CHECK TABLE you may well have some errors
in the output. Also if the MySQL server has been performing strangely, or unexpectedly
been crashing, this may be due to errors somewhere in the table's data. If this is the case,
after checking your table, you may need to run REPAIR TABLE on it to correct any prob-
lems. You do this using the following command:
REPAIR TABLE tablename, tablename, tablename, … options
As you can get many rows of feedback from a table repair, it is best to only repair one
table at a time.
The options can be:
QUICK only tries to repair the index tree of the table.
EXTENDED creates the indexes row by row.
USE_FRM recreates the table from the .frm file in the tables directory.
You will get a similar table of results from REPAIR TABLE as you did with CHECK
TABLE. If the last row of results does not show an OK message, you need to try and repair
MySQL from the command line, not through the monitor. To do this, start a dos session,
change the directory to the directory where your database is stored, i.e.
cd \mysql\data\mysqlfast
Search WWH ::




Custom Search