MySQL database mysqlcheck usage

Source: Internet
Author: User

MySQLDatabaseMysqlcheckThe usage of mysqlcheck is the content we will mainly introduce in this article. We know that mysqlcheck is a mysql-provided mysql table that can be checked and repaired, and it can also be optimized and analyzed, the function of mysqlcheck is similar to that of myisamchk, but it works differently.

The main difference is that mysqlcheck must be used when the mysqld server is running, while myisamchk is used when the server is not running. The advantage of using mysqlcheck is that you do not need to stop the server to check or repair tables. Failure to fix myisamchk is irreversible.

1. If you need to check and repair the data tables of all databases, you can use:

 
 
  1. # mysqlcheck -A -o -r -p  
  2. # Enter password:   
  3. database1 OK  
  4. database2 OK 

2. If you need to repair the specified database

 
 
  1. # mysqlcheck -A -o -r Database_NAME -p 

3. If you use another user name

 
 
  1. # mysqlcheck -A -o -r -p -u admin  
  2. # Enter password:   
  3. database1 OK  
  4. database2 OK 

Here admin is the specified mysql user account.

4. If you use the specified mysql. sock to enter the database and fix it

 
 
  1. # mysqlcheck -A -o -r -p -S /tmp/mysql.sock  
  2. # Enter password:   
  3. database1 OK  
  4. database2 OK 

Here/tmp/mysql. sock is the path where the specified mysql. sock is stored.

This article describes how to use MySQL database mysqlcheck!

Related Article

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.