MySQL flush operation

Source: Internet
Author: User
Tags ip number
Flush syntax
 
Flush[Local | no_write_to_binlog]Flush_option[, Flush_option]...

If you want to clearMySQLYou should useFlushStatement. To executeFlush, You must haveReloadPermission.

 

Flush_option

Hosts

Used to clear the host cache table. If some hosts change the IP number or if you get the error message host host_name is blocked, you should refresh the host table. When connecting to the MySQL server, if an error "more than max_connect_errors" occurs for a given host, MySQL assumes that an error occurs and stops subsequent connection requests from the host. Refresh the host table to allow the host to try again. See section A.2.5, "host host_name is blocked ". You can use max_connect_errors = 999999999 to start mysqld to avoid this error message.

Des_key_file

It is used to re-load the des keyword from the file specified by -- des-key-file when the server is started.

Logs

Used to close and re-open all log files. If you have specified an Update log file or a binary log file without expansion, the log file extension number increases by 1 compared to the previous file. If you use an extension in the file name, MySQL closes and re-opens the log file. In UNIX, this is also true when the mysqld server sends a sighup signal (except for some Mac OS X 10.3 versions. In these versions, mysqld ignores sighup and sigquit ).

If the server uses the -- log-error option, flush logs will rename the error log (with the suffix-old), and mysqld will create a new empty log file. If the -- log-error option is not specified, it will not be renamed.

Privileges

Used to re-load permissions from the authorization table in the MySQL database.

Query Cache

Sort query cache fragments to make better use of memory. Unlike the reset query cache, this statement does not cancel any query from the cache.

Status

It is used to reset most state variables to zero. You must use this item only when debugging a query. See section 1.7.1.3, "How to report defects and problems ".

{Table | tables} [tbl_name [, tbl_name]...]

When no table is named, close all open tables and force them to be closed. This will also refresh the query cache. This option contains one or more table names. Only the specified table is refreshed. Like the reset query cache statement, flush tables also cancels all query results from the query cache.

Tables with read lock

For all databases with read locks, close all open tables and lock all tables until you execute the unlock tables command. If you have a file system that can take snapshots in a timely manner, such as Veritas, this is a very convenient method for backup.

User_resources

It is used to reset all user resources per hour to zero. This allows clients that have reached the hourly connection, query, or update threshold to immediately restore activity. Flush user_resources does not apply to the maximum value of simultaneous connections. See section 13.5.1.3 "Grant and revoke Syntax ".

The flush statement is written to the binary log unless the no_write_to_binlog keyword (or its alias is local) is used ). Note: In any case, flush logs, flush master, flush slave, and flush tables with read lock will not be logged, because if they are copied to a slave server, problems may occur.

You can also use the flush-hosts, flush-logs, flush-privileges, flush-status, or flush-tables commands to access applications containing mysqladmin.Program.

 

From http://dev.mysql.com/doc/refman/5.1/zh/sql-syntax.html#load-index

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.