MySQL common flush syntax

Source: Internet
Author: User

Flush flush_option [, flush_option]. To execute flush, you must have the reload permission.

The content of flush_option is as follows:

Hosts clears the host cache table. If the host changes the IP address, or the host... isblocked error is reported. When you connect to a MySQL server, an error occurs continuously more than max_connect_errors on a given host. For security purposes, MySQL will block further connection requests from the host. Clear the host table to allow the host to try again.

Logs closes the current binary log file and creates a new file. The new binary log file name is added to the number of the current binary file by 1.
 
After privileges is re-authorized, the new permissions take effect immediately, and the permissions are reloaded to the cache from the database authorization table.
 
Tables disables all opened tables and clears the query cache.

Flush tables with read lock disables all opened tables, and adds read locks to all tables in the database until unlock tables is executed explicitly.

Status resets most status variables to 0.

The master node deletes the binary log files in all binary log index files, resets the index file of the binary log file to null, and creates a new binary log file, which is no longer recommended, changed to reset master. In the past, we first checked out the current binary log file name and then used the purge operation.

Query cache reassembles the query cache to eliminate fragments and improve performance, but does not affect the query cache's existing data. This point is flush table and reset query cache (the query cache content will be cleared) different.

Slave is similar to Resetting replication, so that the slave database forgets the replication location of the master database and also deletes the downloaded relay log. Like the master database, it is not recommended anymore, changed to reset slave.

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.