30.5. Enabling MyISAM Auto-Repair


30.5. Enabling MyISAM Auto-Repair

The MySQL server can be instructed to check and repair MyISAM tables automatically. With automatic repair enabled, the server checks each MyISAM table when it opens it to see whether the table was closed properly the last time it was used and is not marked as needing repair. If the table is not okay, the server repairs it.

To enable automatic MyISAM table maintenance, start the server with the --myisam-recover option. The option value can consist of a comma-separated list of one or more of the following values:

  • DEFAULT for the default checking.

  • BACKUP tells the server to make a backup of any table that it must change.

  • FORCE causes table recovery to be performed even if it would cause the loss of more than one row of data.

  • QUICK performs quick recovery: Tables that have no holes resulting from deletes or updates are skipped.

For example, to tell the server to perform a forced recovery of MyISAM tables found to have problems but make a backup of any table it changes, you can put the following lines in an option file:

 [mysqld] myisam-recover=FORCE,BACKUP 



MySQL 5 Certification Study Guide
MySQL 5.0 Certification Study Guide
ISBN: 0672328127
EAN: 2147483647
Year: 2006
Pages: 312

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net