FLUSH PRIVILEGES

The statement FLUSH PRIVILEGES instructs TiDB to reload the in-memory copy of privileges from the privilege tables. You must execute this statement after manually editing tables such as mysql.user. However, executing this statement is not necessary after using privilege statements like GRANT or REVOKE. To execute this statement, the RELOAD privilege is required.

Synopsis

FlushStmt

FLUSH PRIVILEGES - 图1

NoWriteToBinLogAliasOpt

FLUSH PRIVILEGES - 图2

FlushOption

FLUSH PRIVILEGES - 图3

  1. FlushStmt ::=
  2. 'FLUSH' NoWriteToBinLogAliasOpt FlushOption
  3. NoWriteToBinLogAliasOpt ::=
  4. ( 'NO_WRITE_TO_BINLOG' | 'LOCAL' )?
  5. FlushOption ::=
  6. 'PRIVILEGES'
  7. | 'STATUS'
  8. | 'TIDB' 'PLUGINS' PluginNameList
  9. | 'HOSTS'
  10. | LogTypeOpt 'LOGS'
  11. | TableOrTables TableNameListOpt WithReadLockOpt

Examples

  1. mysql> FLUSH PRIVILEGES;
  2. Query OK, 0 rows affected (0.01 sec)

MySQL compatibility

The FLUSH PRIVILEGES statement in TiDB is fully compatible with MySQL. If you find any compatibility differences, report a bug.

See also