MySQL troubleshooting and correction process (2) _ MySQL

Source: Internet
Author: User
General process of MySQL fault detection and correction (2) check the database table

Myisamchk and isamchk provide table check methods that differ in the extent to which a thorough checklist is performed.

Standard method checklist

Generally, the standard method is enough. Check the table using a standard method. you can directly call the table without any options, or use either the-s or -- silent options:

Myisamchk tbl_name isamchk tbl_name

This can identify the 99.99% of all errors. What it cannot find is that it only involves corruption of data files (which is not common ).

Complete and thorough data check

To perform the expansion check, use the -- extend-check or-e option, which checks the data:

Myisamchk-e tbl_name isamchk-e tbl_name
It performs a completely thorough data check (-e means "extension check "). It performs a read check on each row for each key to verify that they actually point to the correct row. This can take a long time on a large table with many keys. Myisamchk usually stops after it discovers the first error. If you want more information, you can add the -- verbose (-v) option. This causes the myisamchk or isamchk to continue up to 20 errors. In general use, a simple standard check (without parameters other than the table name) is enough.

Moderate check

Specify options -- medium-check or-m

Myisamchk-m tbl_name

A moderate check is not as fast as a full extension check. It is of little significance and rarely used.

If no error is reported for the -- extend-check, the table is intact. If you still feel that the table is faulty, the reason must be somewhere else. Re-check and queries that appear to be problematic to verify that the query is correctly written. If you think the problem may be caused by the MySQL server, you should organize a fault report or upgrade it to a new version.

Possible check options:

1.-I or-information: print statistical information, for example:

Myisamchk-e-I tbl_name

Like the previous command, the-I option tells myisamchk to print some statistics.

2.-C, -- check-only-changed

Only the table modified after the last check is checked

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.