faqts : Computers : Databases : MySQL : Shell Commands : myisamchk

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 12 people (67%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

What's the best way to automatically check and repair MySQL tables?

Feb 8th, 2000 06:32
Nathan Wallace, Jason, Sasha Pachev


Make a script (eg: perl) to run myisamchk against each index file. If
corrupted, try a -q repair. If that doesn't fix the corruption, try a
normal repair, and if that doesn't work try an extended repair!  We use
a system like this in our daily scripts and it works great.

For your information, this will be implemented in 3.23.10 inside mysqld,
so you will be able to say VERIFY TABLE my_table and it will check it,
and repair if necessary. You will also be able to force a repair with
REPAIR TABLE.