Linux system under Mysqlcheck Repair Database command (detailed) _mysql

Source: Internet
Author: User

The Mysqlcheck client tool can examine and fix myisam tables, and can also optimize and analyze tables.

In fact, it integrates the functions of check, repair, analyze, optimize in MySQL tools,

There are 3 different ways to invoke Mysqlcheck:

shell> mysqlcheck[options] db_name [tables]

shell> mysqlcheck[options]---database DB1 [DB2 DB3 ...]

Shell> Mysqlcheck[options]--all--database

If you do not specify any tables or use the---database or--all--database option,

The entire database is checked.

option has the following common options:

-C,--check (check sheet);

-R,--repair (repair table);

-A,--analyze (analysis table);

-O,--optimize (tuning table);//Where the default option is-C (checklist)

Example:

checklist (check);

Mysqlcheck-u root-c Test

Repair table (repair);

Mysqlcheck-u root-r Test

Repair the specified database with the

# mysqlcheck-a-o-r database_name-p

Check the repair of all databases (table;

# mysqlcheck-u root-a -0-r-P

Automatically optimizes MySQL database on a regular basis

CRONTAB-E//Add it to the cron job to automate every day at 01:00

0 1 * * * mysqlcheck-aao–auto-repair-u your username-p your password >/dev/null 2>&1

The above Linux system under the Mysqlcheck Repair Database command (detailed) is a small series to share all the content, hope to give you a reference, but also hope that we support the cloud habitat community.

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.