FLUSH STATUS

FLUSH STATUS 语句用于提供 MySQL 兼容性,但在 TiDB 上并无作用。因为 TiDB 使用 Prometheus 和 Grafana 而非 SHOW STATUS 来进行集中度量收集。

语法图

FlushStmt

FLUSH STATUS - 图1

NoWriteToBinLogAliasOpt

FLUSH STATUS - 图2

FlushOption

FLUSH STATUS - 图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

示例

  1. show status;
  1. +--------------------+--------------------------------------+
  2. | Variable_name | Value |
  3. +--------------------+--------------------------------------+
  4. | Ssl_cipher_list | |
  5. | server_id | 93e2e07d-6bb4-4a1b-90b7-e035fae154fe |
  6. | ddl_schema_version | 141 |
  7. | Ssl_verify_mode | 0 |
  8. | Ssl_version | |
  9. | Ssl_cipher | |
  10. +--------------------+--------------------------------------+
  11. 6 rows in set (0.01 sec)
  1. show global status;
  1. +--------------------+--------------------------------------+
  2. | Variable_name | Value |
  3. +--------------------+--------------------------------------+
  4. | Ssl_cipher | |
  5. | Ssl_cipher_list | |
  6. | Ssl_verify_mode | 0 |
  7. | Ssl_version | |
  8. | server_id | 93e2e07d-6bb4-4a1b-90b7-e035fae154fe |
  9. | ddl_schema_version | 141 |
  10. +--------------------+--------------------------------------+
  11. 6 rows in set (0.00 sec)
  1. flush status;
  1. Query OK, 0 rows affected (0.00 sec)
  1. show status;
  1. +--------------------+--------------------------------------+
  2. | Variable_name | Value |
  3. +--------------------+--------------------------------------+
  4. | Ssl_cipher | |
  5. | Ssl_cipher_list | |
  6. | Ssl_verify_mode | 0 |
  7. | Ssl_version | |
  8. | ddl_schema_version | 141 |
  9. | server_id | 93e2e07d-6bb4-4a1b-90b7-e035fae154fe |
  10. +--------------------+--------------------------------------+
  11. 6 rows in set (0.00 sec)

MySQL 兼容性

  • FLUSH STATUS 语句仅用于提供 MySQL 兼容性。

另请参阅