«

MySQL查看数据库状态命令是什么

时间:2024-8-4 06:36     作者:韩俊     分类: Mysql


这篇文章主要介绍了MySQL查看数据库状态命令是什么的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇MySQL查看数据库状态命令是什么文章都会有所收获,下面我们一起来看看吧。

前言

数据查询语言(DQL: Data Query Language):其语句,也称为“数据检索语句”,用以从表中获得数据,确定数据怎样在应用程序给出。保留字SELECT是DQL(也是所有SQL)用得最多的动词,其他DQL常用的保留字有WHERE,ORDER BY,GROUP BY和HAVING。这些DQL保留字常与其它类型的SQL语句一起使用。

show status

使用SHOW STATUS语句能够获取MySQL服务器的一些状态信息,这些状态信息主要是MySQL数据库的性能参数。SHOW STATUS语句的语法格式如下:

SHOW [SESSION | GLOBAL] STATUS LIKE 'status_name';

其中,SESSION表示获取当前会话级别的性能参数,GLOBAL表示获取全局级别的性能参数,并且SESSION和GLOBAL可以省略,如果省略不写,默认为SESSION。status_name表示查询的参数值。熟练掌握这些参数的使用,能够更好地了解SQL语句的执行频率。SHOW STATUS语句支持的参数值

Not_flushed_key_blocks   在键缓存中已经改变但是还没被清空到磁盘上的键块。
Not_flushed_delayed_rows

mysql> show status;
+-----------------------------------------------+--------------------------------------------------+
| Variable_name                                 | Value                                            |
+-----------------------------------------------+--------------------------------------------------+
| Aborted_clients                               | 1  由于客户没有正确关闭连接已经死掉,已经放弃的连接数量|
| Aborted_connects                              | 0  尝试已经失败的MySQL服务器的连接的次数               |
| Binlog_cache_disk_use                         | 0  该状态表示有多少个事务使用了临时文件              |
| Binlog_cache_use                              | 1  有多少个事物使用了ache_size来缓存未提交的事物日志 |
| Binlog_stmt_cache_disk_use                    | 0                                                |
| Binlog_stmt_cache_use                         | 0                                                |
| Bytes_received                                | 248 从客户处已经接收到的字节数                      |
| Bytes_sent                                    | 185 已经发送给所有客户的字节数                      |
| Com_statement                                 | 0   每一个变量语句对应的次数                        |
| Connections                                   | 41472       试图连接MySQL服务器的次数           |
| Created_tmp_disk_tables                       | 0   服务器执行语句时在硬盘上自动创建的临时表的数量    |
| Created_tmp_files                             | 5   mysqld创建的临时文件个数                       |
| Created_tmp_tables                            | 0      当执行语句时,已经被创造了的隐含临时表的数量   |
| Delayed_errors                                | 0 用INSERT DELAYED写入的发生某些错误(可能重复键值)的行数 |
| Delayed_insert_threads                        | 0      正在使用的延迟插入处理器线程的数量            |
| Delayed_writes                                | 0          用INSERT DELAYED写入的行数               |
| Flush_commands                                | 17          执行FLUSH命令的次数                 |
| Handler_commit                                | 0      内部COMMIT命令的个数                        |
| Handler_delete                                | 0      请求从一张表中删除行的次数                    |
| Handler_discover                              | 0 MySQL服务器可以问NDB CLUSTER存储引擎是否知道某一名字的表 |
| Handler_external_lock                         | 0                                                |
| Handler_mrr_init                              | 0                                                |
| Handler_prepare                               | 0      两阶段提交操作准备阶段的计数器               |
| Handler_read_first                            | 0      请求读入表中第一行的次数                     |
| Handler_read_key                              | 0      请求数字基于键读行                          |
| Handler_read_last                             | 0                                                |
| Handler_read_next                             | 0      请求读入基于一个键的一行的次数               |
| Handler_read_prev                             | 0      按照索引的顺序读取前面一行数据的请求的个数     |
| Handler_read_rnd                              | 0      请求读入基于一个固定位置的一行的次数          |
| Handler_read_rnd_next                         | 0      读取数据文件中下一行数据的请求的个数          |
| Handler_rollback                              | 0      内部ROLLBACK命令的数量                     |
| Handler_savepoint                             | 0      在一个存储引擎放置一个保存点的请求数量        |
| Handler_savepoint_rollback                    | 0      在一个存储引擎的要求回滚到一个保存点数目       |
| Handler_update                                | 0      请求更新表中一行的次数                     |
| Handler_write                                 | 0      请求向表中插入一行的次数                    |
| Innodb_buffer_pool_dump_status                | Dumping of buffer pool not started               |
| Innodb_buffer_pool_load_status                | Buffer pool(s) load completed at 220224 21:04:35 |
| Innodb_buffer_pool_resize_status              |                                                  |
| Innodb_buffer_pool_pages_data                 | 32422                                            |
| Innodb_buffer_pool_bytes_data                 | 531202048                                        |
| Innodb_buffer_pool_pages_dirty                | 0                                                |
| Innodb_buffer_pool_bytes_dirty                | 0                                                |
| Innodb_buffer_pool_pages_flushed              | 235                                              |
| Innodb_buffer_pool_pages_free                 | 97929                                            |
| Innodb_buffer_pool_pages_misc                 | 705                                              |
| Innodb_buffer_pool_pages_total                | 131056                                           |
| Innodb_buffer_pool_read_ahead_rnd             | 0                                                |
| Innodb_buffer_pool_read_ahead                 | 23377                                            |
| Innodb_buffer_pool_read_ahead_evicted         | 0                                                |
| Innodb_buffer_pool_read_requests              | 330362716      InnoDB已经完成的逻辑读请求数        |
| Innodb_buffer_pool_reads                      | 9004                                             |
| Innodb_buffer_pool_wait_free                  | 0                                                |
| Innodb_buffer_pool_write_requests             | 3783                                             |
| Innodb_data_fsyncs                            | 47                                               |
| Innodb_data_pending_fsyncs                    | 0                                                |
| Innodb_data_pending_reads                     | 0                                                |
| Innodb_data_pending_writes                    | 0                                                |
| Innodb_data_read                              | 530813440                                        |
| Innodb_data_reads                             | 33379                                            |
| Innodb_data_writes                            | 279                                              |
| Innodb_data_written                           | 4193792      至此已经写入的数据量(字节)           |
| Innodb_dblwr_pages_written                    | 20                                               |
| Innodb_dblwr_writes                           | 10                                               |
| Innodb_log_waits                              | 0            我们必须等待的时间                    |
| Innodb_log_write_requests                     | 9              日志写请求数                       |
| Innodb_log_writes                             | 15            向日志文件的物理写数量               |
| Innodb_os_log_fsyncs                          | 22           向日志文件完成的fsync()写数量         |
| Innodb_os_log_pending_fsyncs                  | 0            挂起的日志文件fsync()操作数量         |
| Innodb_os_log_pending_writes                  | 0            挂起的日志文件写操作                  |
| Innodb_os_log_written                         | 12288          写入日志文件的字节数                |
| Innodb_page_size                              | 16384          编译的InnoDB页大小(默认16KB)        |
| Innodb_pages_created                          | 42                    创建的页数                  |
| Innodb_pages_read                             | 32380                 读取的页数                  |
| Innodb_pages_written                          | 235                   写入的页数                  |
| Innodb_row_lock_current_waits                 | 0               当前等待的待锁定的行数             |
| Innodb_row_lock_time                          | 0              行锁定花费的总时间,单位毫秒         |
| Innodb_row_lock_time_avg                      | 0              行锁定的平均时间,单位毫秒           |
| Innodb_row_lock_time_max                      | 0              行锁定的最长时间,单位毫秒           |
| Innodb_row_lock_waits                         | 0              一行锁定必须等待的时间数             |
| Innodb_rows_deleted                           | 6              从InnoDB表删除的行数                |
| Innodb_rows_inserted                          | 2193           插入到InnoDB表的行数                |
| Innodb_rows_read                              | 351814064      从InnoDB表读取的行数                |
| Innodb_rows_updated                           | 0              InnoDB表内更新的行数                |
| Innodb_num_open_files                         | 136                                              |
| Innodb_truncated_status_writes                | 0                                                |
| Innodb_available_undo_logs                    | 128                                              |
| Key_blocks_not_flushed                        | 0  键缓存内已经更改但还没有清空到硬盘上的键的数据块数量|
| Key_blocks_unused                             | 53585       键缓存内未使用的块数量                 |
| Key_blocks_used                               | 3           用于关键字缓存的块的数量                |
| Key_read_requests                             | 6           请求从缓存读入一个键值的次数            |
| Key_reads                                     | 3           从磁盘物理读入一个键值的次数            |
| Key_write_requests                            | 0           请求将一个关键字块写入缓存次数          |
| Key_writes                                    | 0           将一个键值块物理写入磁盘的次数          |
| Last_query_cost                               | 0.000000                                         |
| Last_query_partial_plans                      | 0                                                |
| Locked_connects                               | 0                                                |
| Max_execution_time_exceeded                   | 0                                                |
| Max_execution_time_set                        | 0                                                |
| Max_execution_time_set_failed                 | 0                                                |
| Max_used_con

标签: mysql

热门推荐