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.