Name
FLUSH
Syntax
FLUSH option[, option...]
Description
Flushes or resets various internal processes depending on the options
given. You must have RELOAD
privileges to execute
this statement. The option can be any of the following:
-
DES_KEY_FILE
Reloads the DES keys from the file originally specified with the --des-key-file option.
-
HOSTS
Empties the cache table that stores hostname information for clients. This should be used if a client changes IP addresses, or if there are errors related to connecting to the host.
-
LOGS
Closes all the standard log files and reopens them. This can be used if a log file has changed its inode number. If no specific extension has been given to the update log, a new update log will be opened with the extension incremented by one.
-
PRIVILEGES
Reloads all the internal MySQL permissions grant tables. This must be run for any changes to the tables to take effect.
-
QUERY CACHE
For better memory use, this command defragments the query cache but it does not delete queries from the cache.
-
STATUS
Resets the status variables that keep track of the current state of the server.
-
TABLE
table
TABLES
table
,
table2
, ...,
tablen
Flushes only the specified tables.
-
TABLES [WITH READ LOCK]
Closes all currently open tables and flushes any cached data to disk. With a read lock, it acquires a read lock that will not be released until
UNLOCK
TABLES
is issued.
Get Managing & Using MySQL, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.