码迷,mamicode.com
首页 > 数据库 > 详细

MySQL状态变量详解

时间:2019-01-12 21:44:05      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:nsa   存储   进制   二进制   连接   font   install   like   shutdown   

MySQL状态变量详解

mysql的状态变量(status variables)记录的mysql服务器的运行状态信息。查看语法如下:

SHOW [GLOBAL | SESSION] STATUS;

SHOW STATUS命令会显示每个服务器变量的名字和值,状态变量是只读的。我们可以在MySQL客户端下运行SHOW STATUS或者在命令行运用mysqladmin extended-status来查看这

些变量。如果使用SQL命令,可以使用LIKE或者WHERE来限制结果。LIKE可以对变量名做标准模式匹配。

SHOW STATUS中混杂了全局和会话变量,其中许多变量有双重域:既是全局变量,也是会话变量,有相同的名字。如果只需要看全局变量,需要改为SHOW GLOBAL STATUS查看

变量详解:

变量名 变量说明
Aborted_clients 由于客户端未正确关闭连接而终止的连接数 
Aborted_connects 尝试连接到MySQL服务器失败的次数 
Binlog_cache_disk_use 使用临时二进制日志缓存但超过binlog_cache_size值并使用临时文件存储来自事务的语句的事务数 
Binlog_cache_use 使用二进制日志缓存的事务数
Binlog_stmt_cache_disk_use 使用二进制日志语句缓存但超过的非事务语句数binlog_stmt_cache_size的值,并使用临时文件存储这些语句 
Binlog_stmt_cache_use 使用二进制日志语句缓存的非事务性语句数 
Bytes_received 239  从所有客户端接收的字节数 
Bytes_sent 176  发送到所有客户端的字节数 
Com_admin_commands admin语句计数 
Com_assign_to_keycache 缓存索引语句计数 
Com_alter_db alter database语句计数 
Com_alter_db_upgrade alter database ... upgrade data directory name 语句计数 
Com_alter_event alter event语句计数 
Com_alter_function alter function语句计数 
Com_alter_instance  
Com_alter_procedure alter procedure语句计数 
Com_alter_server alter server语句计数
Com_alter_table alter table语句计数 
Com_alter_tablespace alter tablespace语句计数 
Com_alter_user alter user语句计数 
Com_analyze analyze语句计数
Com_begin begin语句计数 
Com_binlog binlog语句计数 
Com_call_procedure call procedure语句计数 
Com_change_db change database语句计数 
Com_change_master change master to语句计数 
Com_change_repl_filter change replication filter语句计数 
Com_check check语句计数 
Com_checksum checksum语句计数 
Com_commit commit语句计数 
Com_create_db create database语句计数 
Com_create_event create event语句计数 
Com_create_function create function语句计数 
Com_create_index create index语句计数 
Com_create_procedure create procudure语句计数 
Com_create_server create server语句计数 
Com_create_table create table语句计数 
Com_create_trigger create trigger语句计数 
Com_create_udf create udf语句计数 
Com_create_user create user语句计数 
Com_create_view create view语句计数 
Com_dealloc_sql deallocate prepare语句计数 
Com_delete delete语句计数 
Com_delete_multi multiple table delete语句计数 
Com_do do语句计数 
Com_drop_db drop database语句计数
Com_drop_event drop event句计数
Com_drop_function drop function语句计数 
Com_drop_index drop index语句计数 
Com_drop_procedure drop procedure语句计数 
Com_drop_server drop server语句计数 
Com_drop_table drop table语句计数 
Com_drop_trigger drop triger语句计数 
Com_drop_user drop user语句计数 
Com_drop_view drop view语句计数 
Com_empty_query empty语句计数 
Com_execute_sql execute语句计数 
Com_explain_other explain for connection语句计数 
Com_flush flush语句计数 
Com_get_diagnostics get diagnostics语句计数 
Com_grant grant语句计数 
Com_ha_close handler close语句计数 
Com_ha_open handler open语句计数 
Com_ha_read handler read语句计数
Com_help help语句计数 
Com_insert insert语句计数
Com_insert_select insert..select..语句计数 
Com_install_plugin install plugin语句计数 
Com_kill kill语句计数 
Com_load load语句计数 
Com_lock_tables lock tables语句计数 
Com_optimize optimize语句计数 
Com_preload_keys preload语句计数 
Com_prepare_sql prepare语句计数 
Com_purge purge语句计数 
Com_purge_before_date purge before date语句计数 
Com_release_savepoint release savepoint语句计数 
Com_rename_table rename table语句计数 
Com_rename_user rename user语句计数 
Com_repair repair语句计数 
Com_replace replace语句计数 
Com_replace_select replace select语句计数 
Com_reset reset语句计数 
Com_resignal resignal语句计数 
Com_revoke revoke语句计数 
Com_revoke_all revoke all语句计数 
Com_rollback rollback语句计数 
Com_rollback_to_savepoint rollback to savepoint语句计数 
Com_savepoint savepoint语句计数 
Com_select select语句计数 
Com_set_option  set option语句计数 
Com_signal  signal语句计数 
Com_show_binlog_events show binlog events语句计数 
Com_show_binlogs show binary logs语句计数 
Com_show_charsets show charset语句计数 
Com_show_collations show clooation语句计数 
Com_show_create_db show create database语句计数 
Com_show_create_event show create event语句计数 
Com_show_create_func show create function语句计数
Com_show_create_proc show create procedure语句计数 
Com_show_create_table show create table语句计数 
Com_show_create_trigger show create trigger语句计数 
Com_show_databases show databases语句计数 
Com_show_engine_logs show engine logs语句计数
Com_show_engine_mutex show engine mutex语句计数 
Com_show_engine_status show engine status语句计数 
Com_show_events show events语句计数 
Com_show_errors show errors语句计数 
Com_show_fields show fields语句计数 
Com_show_function_code show function code语句计数 
Com_show_function_status show function status语句计数 
Com_show_grants show grant语句计数 
Com_show_keys show key语句计数 
Com_show_master_status show master status语句计数 
Com_show_open_tables show open tables语句计数 
Com_show_plugins show plugin语句计数
Com_show_privileges show privileges语句计数 
Com_show_procedure_code show proceudre code语句计数 
Com_show_procedure_status show procedure status语句计数
Com_show_processlist show processlist语句计数 
Com_show_profile show profile语句计数 
Com_show_profiles show profiles语句计数 
Com_show_relaylog_events show relaylog events语句计数 
Com_show_slave_hosts show slave hosts语句计数 
Com_show_slave_status show slave status语句计数 
Com_show_status show status语句计数 
Com_show_storage_engines show storage engines(show engines)语句计数 
Com_show_table_status show table status语句计数 
Com_show_tables show tables语句计数 
Com_show_triggers show triggers语句计数 
Com_show_variables show variables语句计数 
Com_show_warnings show warnings语句计数 
Com_show_create_user show create user语句计数 
Com_shutdown shutdown语句计数 
Com_slave_start start slave语句计数 
Com_slave_stop stop slave语句计数
Com_group_replication_start start group_replication语句计数 
Com_group_replication_stop stop group_replication语句计数 
Com_stmt_execute statement execute语句计数 
Com_stmt_close statement close语句计数 
Com_stmt_fetch statement fetch语句计数 
Com_stmt_prepare statement prepare语句计数 
Com_stmt_reset statement reset语句计数 
Com_stmt_send_long_data statement execute语句计数 
Com_truncate statement send long data语句计数 
Com_uninstall_plugin uninstall plugin语句计数 
Com_unlock_tables unlock tables语句计数 
Com_update update语句计数 
Com_update_multi multiple语句计数 
Com_xa_commit xa commit语句计数
Com_xa_end xa end语句计数 
Com_xa_prepare xa prepare语句计数 
Com_xa_recover xa recover语句计数 
Com_xa_rollback xa rollback语句计数 
Com_xa_start xa start语句计数 
Com_stmt_reprepare statement reprepare语句计数 
Compression OFF   
Connection_errors_accept  
Connection_errors_internal  
Connection_errors_max_connections   
Connection_errors_peer_address  
Connection_errors_select   
Connection_errors_tcpwrap   
Connections 34   
Created_tmp_disk_tables  
Created_tmp_files  
Created_tmp_tables  0  
Delayed_errors  
Delayed_insert_threads  
Delayed_writes  
Flush_commands  
Handler_commit 0  
Handler_delete  
Handler_discover  
Handler_external_lock  
Handler_mrr_init  
Handler_prepare  
Handler_read_first  
Handler_read_key  
Handler_read_last  
Handler_read_next  
Handler_read_prev  
Handler_read_rnd   
Handler_read_rnd_next  
Handler_rollback  
Handler_savepoint  
Handler_savepoint  
Handler_update  0  
Handler_write  0  
Innodb_buffer_pool_dump_status  Dumping of buffer pol not started   
Innodb_buffer_pool_load_status  Buffer pool(s) loadcompleted at 181221 13:15:19   
Innodb_buffer_pool_resize_status     
Innodb_buffer_pool_pages_data  417  
Innodb_buffer_pool_bytes_data 6832128   
Innodb_buffer_pool_pages_dirty  
Innodb_buffer_pool_bytes_dirty  
Innodb_buffer_pool_pages_flushed  39   
Innodb_buffer_pool_pages_free  7775   
Innodb_buffer_pool_pages_misc   
Innodb_buffer_pool_pages_total 8192   
Innodb_buffer_pool_read_ahead_rnd  
Innodb_buffer_pool_read_ahead  
Innodb_buffer_pool_read_ahead_evicted  
Innodb_buffer_pool_read_requests 1722   
Innodb_buffer_pool_reads 383   
Innodb_buffer_pool_wait_free  
Innodb_buffer_pool_write_requests 345   
Innodb_data_fsyncs  
Innodb_data_pending_fsyncs  
Innodb_data_pending_reads  
Innodb_data_pending_writes  
Innodb_data_read 7459328   
Innodb_data_reads 508   
Innodb_data_writes 56   
Innodb_data_written 673792   
Innodb_dblwr_pages_written   
Innodb_dblwr_writes  
Innodb_log_waits   
Innodb_log_write_requests  
Innodb_log_writes  
Innodb_os_log_fsyncs  
Innodb_os_log_pending_fsyncs  
Innodb_os_log_pending_writes  
Innodb_os_log_written 1024   
Innodb_page_size 16384   
Innodb_pages_created 35   
Innodb_pages_read 382   
Innodb_pages_written 39   
Innodb_row_lock_current_waits  
Innodb_row_lock_time  
Innodb_row_lock_time_avg  
Innodb_row_lock_time_max  
Innodb_row_lock_waits  
Innodb_rows_deleted   
Innodb_rows_inserted 45   
Innodb_rows_read 54   
Innodb_rows_updated  
Innodb_num_open_files  26   
Innodb_truncated_status_writes   
Innodb_available_undo_logs  128   
Key_blocks_not_flushed   
Key_blocks_unused 6693   
Key_blocks_used  
Key_read_requests   
Key_reads   
Key_write_requests   
Key_writes   
Last_query_cost  0.000000   
Last_query_partial_plans   
Locked_connects  
Max_execution_time_exceeded  
Max_execution_time_set   
Max_execution_time_set_failed  
Max_used_connections   
Max_used_connections_time 2018-12-22 10:27:47  
Not_flushed_delayed_rows 0  
Ongoing_anonymous_transaction_count   
Open_files 20   
Open_streams   
Open_table_definitions  113   
Open_tables  121   
Opened_files  162   
Opened_table_definitions   
Opened_tables   
Performance_schema_accounts_lost  
Performance_schema_cond_classes_lost  
Performance_schema_cond_instances_lost  
Performance_schema_digest_lost  
Performance_schema_file_classes_lost  
Performance_schema_file_handles_lost  
Performance_schema_file_instances_lost  
Performance_schema_hosts_lost  
Performance_schema_index_stat_lost  
Performance_schema_locker_lost  
Performance_schema_memory_classes_lost  
Performance_schema_metadata_lock_lost  
Performance_schema_mutex_classes_lost  
Performance_schema_mutex_instances_lost  
Performance_schema_nested_statement_lost  
Performance_schema_prepared_statements_lost   
Performance_schema_program_lost  
Performance_schema_rwlock_classes_lost  
Performance_schema_rwlock_instances_lost  
Performance_schema_session_connect_attrs_lost  
Performance_schema_socket_classes_lost  
Performance_schema_socket_instances_lost  
Performance_schema_stage_classes_lost   
Performance_schema_statement_classes_lost  
Performance_schema_table_handles_lost  
Performance_schema_table_instances_lost  
Performance_schema_table_lock_stat_lost  
Performance_schema_thread_classes_lost  
Performance_schema_thread_instances_lost  
Performance_schema_users_lost  
Prepared_stmt_count  
Qcache_free_blocks  
Qcache_free_memory 1031832   
Qcache_hits  
Qcache_inserts   
Qcache_lowmem_prunes   
Qcache_not_cached  26   
Qcache_queries_in_cache   
Qcache_total_blocks   
Queries  127   
Questions   
Select_full_join   
Select_full_range_join   
Select_range  
Select_range_check   
Select_scan  
Slave_open_temp_tables   
Slow_launch_threads   
Slow_queries   
Sort_merge_passes   
Sort_range  
Sort_rows  0  
Sort_scan   
Ssl_accept_renegotiates   
Ssl_accepts   
Ssl_callback_cache_hits  
Ssl_cipher     
Ssl_cipher_list     
Ssl_client_connects   
Ssl_connect_renegotiates   
Ssl_ctx_verify_depth   
Ssl_ctx_verify_mode   
Ssl_default_timeout   
Ssl_finished_accepts   
Ssl_finished_connects   
Ssl_server_not_after     
Ssl_server_not_before     
Ssl_session_cache_hits  0  
Ssl_session_cache_misses  0  
Ssl_session_cache_mode     
Ssl_session_cache_overflows  0  
Ssl_session_cache_size  
Ssl_session_cache_timeouts   
Ssl_sessions_reused   
Ssl_used_session_cache_entries   
Ssl_verify_depth  
Ssl_verify_mode   
Ssl_version     
Table_locks_immediate  143   
Table_locks_waited   
Table_open_cache_hits   
Table_open_cache_misses   
Table_open_cache_overflows   
Tc_log_max_pages_used   
Tc_log_page_size  
Tc_log_page_waits   
Threads_cached   
Threads_connected   
Threads_created   
Threads_running   
Uptime 114789   
Uptime_since_flush_status 114789   

MySQL状态变量详解

标签:nsa   存储   进制   二进制   连接   font   install   like   shutdown   

原文地址:https://www.cnblogs.com/jkin/p/10260656.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!