Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to MySQL SHOW STATUS command

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

SHOW STATUS provides status information for the MySQL service, and executing this statement requires only permission to connect to the MySQL database.

These service status information comes from the following:

Table of ① performance users.

GLOBAL_STATUS and SESSION_ tables under ② INFORMATION_SCHEMA users.

MariaDB [test] > desc information_schema.global_status

+-+ +

| | Field | Type | Null | Key | Default | Extra | |

+-+ +

| | VARIABLE_NAME | varchar (64) | NO | |

| | VARIABLE_VALUE | varchar (2048) | NO | |

+-+ +

2 rows in set (0.12 sec)

MariaDB [test] > select * from information_schema.global_status where variable_name like 'Com_insert%'

+-+ +

| | VARIABLE_NAME | VARIABLE_VALUE |

+-+ +

| | COM_INSERT | 106 | |

| | COM_INSERT_SELECT | 10 | |

+-+ +

2 rows in set (0.00 sec)

MariaDB [test] > desc information_schema.session_status

+-+ +

| | Field | Type | Null | Key | Default | Extra | |

+-+ +

| | VARIABLE_NAME | varchar (64) | NO | |

| | VARIABLE_VALUE | varchar (2048) | NO | |

+-+ +

2 rows in set (0.00 sec)

MariaDB [test] > select * from information_schema.session_status where variable_name like 'Com_insert%'

+-+ +

| | VARIABLE_NAME | VARIABLE_VALUE |

+-+ +

| | COM_INSERT | 19 | |

| | COM_INSERT_SELECT | 0 | |

+-+ +

2 rows in set (0.00 sec)

Extended-status command for ③ mysqladmin

[root@localhost 20160630] # / maria/bin/mysqladmin-uroot-p extended-status | grep Com | more

Enter password:

| | Com_admin_commands | 0 | |

| | Com_alter_db | 0 | |

| | Com_alter_db_upgrade | 0 | |

| | Com_alter_event | 0 | |

| | Com_alter_function | 0 | |

| | Com_alter_procedure | 0 | |

| | Com_alter_server | 0 | |

| | Com_alter_table | 40 | |

| | Com_alter_tablespace | 0 | |

| | Com_analyze | 3 | |

| | Com_assign_to_keycache | 0 | |

| | Com_begin | 0 | |

| | Com_binlog | 0 | |

| | Com_call_procedure | 3 | |

| | Com_change_db | 43 | |

| | Com_change_master | 0 | |

| | Com_check | 0 | |

| | Com_checksum | 0 | |

| | Com_commit | 0 | |

| | Com_compound_sql | 0 | |

| | Com_create_db | 1 | |

| | Com_create_event | 0 | |

| | Com_create_function | 0 | |

| | Com_create_index | 4 |

| | Com_create_procedure | 4 |

SHOW STATUS accepts GLOBAL or SESSION parameters, showing global or current connection session information, respectively, or current session information if no parameters are taken.

Each call to the SHOW STATUS statement uses a temporary table and increments the value of the Created_tmp_tables global parameter.

MariaDB [test] > show global status like 'Created_tmp_tables'

+-+ +

| | Variable_name | Value |

+-+ +

| | Created_tmp_tables | 894 | |

+-+ +

1 row in set (0.00 sec)

MariaDB [test] > show global status like 'Created_tmp_tables'

+-+ +

| | Variable_name | Value |

+-+ +

| | Created_tmp_tables | 895 | |

+-+ +

1 row in set (0.00 sec)

Commonly used statistical parameters

The number of times Com_select performed SELECT operations

The number of times Com_insert performed INSERT operations

The number of times Com_update performed UPDATE operations

The number of times Com_delete performed DELETE operations

Number of rows returned by the SELECT query of the Innodb_rows_read InnoDB storage engine

Number of rows inserted by the Innodb_rows_inserted InnoDB storage engine to perform INSERT operations

The number of rows updated by the Innodb_rows_updated InnoDB storage engine for UPDATE operations

The number of rows deleted by the Innodb_rows_deleted InnoDB storage engine performing DELETE operations

Number of Connections connections

Uptime server working time

Number of Slow_queries slow queries

MariaDB [test] > show global status like 'Innodb_rows%'

+-+ +

| | Variable_name | Value |

+-+ +

| | Innodb_rows_deleted | 512 | |

| | Innodb_rows_inserted | 1662 | |

| | Innodb_rows_read | 4557 | |

| | Innodb_rows_updated | 4 |

+-+ +

4 rows in set (0.00 sec)

MariaDB [test] > show global status like 'Connection%'

+-+ +

| | Variable_name | Value |

+-+ +

| | Connection_errors_accept | 0 | |

| | Connection_errors_internal | 0 | |

| | Connection_errors_max_connections | 0 | |

| | Connection_errors_peer_address | 0 | |

| | Connection_errors_select | 0 | |

| | Connection_errors_tcpwrap | 0 | |

| | Connections | 15 |

+-+ +

7 rows in set (0.00 sec)

MariaDB [test] > show global status like 'Uptime%'

+-+ +

| | Variable_name | Value |

+-+ +

| | Uptime | 1285789 | |

| | Uptime_since_flush_status | 1285789 | |

+-+ +

2 rows in set (0.00 sec)

MariaDB [test] > show global status like 'Slow_queries%'

+-+ +

| | Variable_name | Value |

+-+ +

| | Slow_queries | 0 | |

+-+ +

1 row in set (0.00 sec)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report