DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(mysql.info) flush

Info Catalog (mysql.info) cache-index (mysql.info) other-administrative-sql (mysql.info) kill
 
 13.5.5.2 `FLUSH' Syntax
 .......................
 
      FLUSH [LOCAL | NO_WRITE_TO_BINLOG] FLUSH_OPTION [, FLUSH_OPTION] ...
 
 The `FLUSH' statement clears or reloads various internal caches used by
 MySQL. To execute `FLUSH', you must have the `RELOAD' privilege.
 
 The `RESET' statement is similar to `FLUSH'. See  reset.
 
 FLUSH_OPTION can be any of the following:
 
    * `HOSTS'
 
      Empties the host cache tables. You should flush the host tables if
      some of your hosts change IP number or if you get the error
      message `Host 'HOST_NAME' is blocked'. When more than
      `max_connect_errors' errors occur successively for a given host
      while connecting to the MySQL server, MySQL assumes that something
      is wrong and blocks the host from further connection requests.
      Flushing the host tables allows the host to attempt to connect
      again. See  blocked-host. You can start `mysqld' with
      -max_connect_errors=999999999 to avoid this error message.
 
    * `DES_KEY_FILE'
 
      Reloads the DES keys from the file that was specified with the
      -des-key-file option at server startup time.
 
    * `LOGS'
 
      Closes and reopens all log files. If binary logging is enabled,
      the sequence number of the binary log file is incremented by one
      relative to the previous file. On Unix, this is the same thing as
      sending a `SIGHUP' signal to the `mysqld' server (except on some
      Mac OS X 10.3 versions where `mysqld' ignores `SIGHUP' and
      `SIGQUIT').
 
      If the server was started with the -log-error option, `FLUSH LOGS'
      causes the error log is renamed with a suffix of `-old' and
      `mysqld' creates a new empty log file. No renaming occurs if the
      -log-error option was not given.
 
    * `PRIVILEGES'
 
      Reloads the privileges from the grant tables in the `mysql'
      database.
 
    * `QUERY CACHE'
 
      Defragment the query cache to better utilize its memory.  `FLUSH
      QUERY CACHE' does not remove any queries from the cache, unlike
      `RESET QUERY CACHE'.
 
    * `STATUS'
 
      Resets most status variables to zero. This is something you should
      use only when debugging a query. See  bug-reports.
 
    * `{TABLE | TABLES} [TBL_NAME [, TBL_NAME] ...]'
 
      When no tables are named, closes all open tables and forces all
      tables in use to be closed. This also flushes the query cache.
      With one or more table names, flushes only the given tables.
      `FLUSH TABLES' also removes all query results from the query
      cache, like the `RESET QUERY CACHE' statement.
 
    * `TABLES WITH READ LOCK'
 
      Closes all open tables and locks all tables for all databases with
      a read lock until you execute `UNLOCK TABLES'. This is very
      convenient way to get backups if you have a filesystem such as
      Veritas that can take snapshots in time.
 
    * `USER_RESOURCES'
 
      Resets all per-hour user resources to zero. This enables clients
      that have reached their hourly connection, query, or update limits
      to resume activity immediately.  `FLUSH USER_RESOURCES' does not
      apply to the limit on maximum simultaneous connections. See 
      grant.
 
 `FLUSH' statements are written to the binary log unless the optional
 `NO_WRITE_TO_BINLOG' keyword (or its alias `LOCAL') is used. This is
 done so that `FLUSH' statements used on a MySQL server acting as a
 replication master will be replicated by default to the replication
 slave.
 
 * `FLUSH LOGS', `FLUSH MASTER', `FLUSH SLAVE', and `FLUSH TABLES
 WITH READ LOCK' are not logged in any case because they would cause
 problems if replicated to a slave.
 
 You can also access some of these statements with the `mysqladmin'
 utility, using the `flush-hosts', `flush-logs', `flush-privileges',
 `flush-status', or `flush-tables' commands.
 
 Using `FLUSH' statements within stored functions or triggers is not
 supported in MySQL 5.0.19. As of MySQL 5.0.12, it is no longer possible
 to do so at all. However, you may use `FLUSH' in stored procedures, so
 long as these are not called from stored functions or triggers. See
  routine-restrictions.
 
 See also  reset, for information about how the `RESET' statement
 is used with replication.
 
Info Catalog (mysql.info) cache-index (mysql.info) other-administrative-sql (mysql.info) kill
automatically generated byinfo2html