Get the database server status in MySQL
SHOW STATUS;
Check database server status at session level
SHOW SESSION STATUS;
Check database server status at Global level
SHOW GLOBAL STATUS;
Example of using LIKE or WHERE operator with these commands:
SHOW [GLOBAL | SESSION] STATUS LIKE 'Key%';
SHOW [GLOBAL | SESSION] STATUS WHERE VALUE > 0;
Example:
mysql> SHOW GLOBAL STATUS LIKE 'Key%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| Key_blocks_not_flushed | 0 |
| Key_blocks_unused | 6698 |
| Key_blocks_used | 0 |
| Key_read_requests | 0 |
| Key_reads | 0 |
| Key_write_requests | 0 |
| Key_writes | 0 |
+------------------------+-------+
7 rows in set (0.00 sec)
mysql> SHOW GLOBAL STATUS WHERE VALUE > 1000000;
+-------------------------------+----------------------+
| Variable_name | Value |
+-------------------------------+----------------------+
| Error_log_latest_write | 1623916545647234 |
| Innodb_buffer_pool_bytes_data | 6848512 |
| Innodb_data_read | 88937472 |
| Innodb_data_written | 18571264 |
| Mysqlx_ssl_ctx_verify_depth | 18446744073709551615 |
| Ssl_ctx_verify_depth | 4294967295 |
| Ssl_verify_depth | 4294967295 |
+-------------------------------+----------------------+
7 rows in set, 20 warnings (0.00 sec)