| title | FLUSH PRIVILEGES | TiDB SQL Statement Reference | ||
|---|---|---|---|
| summary | An overview of the usage of FLUSH PRIVILEGES for the TiDB database. | ||
| aliases |
|
The FLUSH PRIVILEGES statement refreshes the in-memory privilege cache of TiDB from the privilege tables. You must execute this statement after manually editing privilege 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.
FlushStmt ::=
'FLUSH' NoWriteToBinLogAliasOpt FlushOption
NoWriteToBinLogAliasOpt ::=
( 'NO_WRITE_TO_BINLOG' | 'LOCAL' )?
FlushOption ::=
'PRIVILEGES'
| 'STATUS'
| 'TIDB' 'PLUGINS' PluginNameList
| 'HOSTS'
| LogTypeOpt 'LOGS'
| TableOrTables TableNameListOpt WithReadLockOpt
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)The FLUSH PRIVILEGES statement in TiDB is fully compatible with MySQL. If you find any compatibility differences, report a bug.