5.1.6. Server Status Variables

The server maintains many status variables that provide information about its operation. You can view these variables and their values by using the SHOW [GLOBAL | SESSION] STATUS statement (see Section 13.7.5.34, "SHOW STATUS Syntax"). The optional GLOBAL keyword aggregates the values over all connections, and SESSION shows the values for the current connection.

mysql> SHOW GLOBAL STATUS;+-----------------------------------+------------+| Variable_name                     | Value      |+-----------------------------------+------------+| Aborted_clients                   | 0          || Aborted_connects                  | 0          || Bytes_received                    | 155372598  || Bytes_sent                        | 1176560426 |...| Connections                       | 30023      || Created_tmp_disk_tables           | 0          || Created_tmp_files                 | 3          || Created_tmp_tables                | 2          |...| Threads_created                   | 217        || Threads_running                   | 88         || Uptime                            | 1389872    |+-----------------------------------+------------+

Many status variables are reset to 0 by the FLUSH STATUS statement.

The following table lists all available server status variables:

Table 5.4. Status Variable Summary

Variable Name Variable Type Variable Scope
Aborted_clients numeric GLOBAL
Aborted_connects numeric GLOBAL
Binlog_cache_disk_use numeric GLOBAL
Binlog_cache_use numeric GLOBAL
Binlog_stmt_cache_disk_use numeric GLOBAL
Binlog_stmt_cache_use numeric GLOBAL
Bytes_received numeric GLOBAL | SESSION
Bytes_sent numeric GLOBAL | SESSION
Com_admin_commands numeric GLOBAL | SESSION
Com_alter_db numeric GLOBAL | SESSION
Com_alter_db_upgrade numeric GLOBAL | SESSION
Com_alter_event numeric GLOBAL | SESSION
Com_alter_function numeric GLOBAL | SESSION
Com_alter_procedure numeric GLOBAL | SESSION
Com_alter_server numeric GLOBAL | SESSION
Com_alter_table numeric GLOBAL | SESSION
Com_alter_tablespace numeric GLOBAL | SESSION
Com_alter_user numeric GLOBAL | SESSION
Com_analyze numeric GLOBAL | SESSION
Com_assign_to_keycache numeric GLOBAL | SESSION
Com_begin numeric GLOBAL | SESSION
Com_binlog numeric GLOBAL | SESSION
Com_call_procedure numeric GLOBAL | SESSION
Com_change_db numeric GLOBAL | SESSION
Com_change_master numeric GLOBAL | SESSION
Com_check numeric GLOBAL | SESSION
Com_checksum numeric GLOBAL | SESSION
Com_commit numeric GLOBAL | SESSION
Com_create_db numeric GLOBAL | SESSION
Com_create_event numeric GLOBAL | SESSION
Com_create_function numeric GLOBAL | SESSION
Com_create_index numeric GLOBAL | SESSION
Com_create_procedure numeric GLOBAL | SESSION
Com_create_server numeric GLOBAL | SESSION
Com_create_table numeric GLOBAL | SESSION
Com_create_trigger numeric GLOBAL | SESSION
Com_create_udf numeric GLOBAL | SESSION
Com_create_user numeric GLOBAL | SESSION
Com_create_view numeric GLOBAL | SESSION
Com_dealloc_sql numeric GLOBAL | SESSION
Com_delete numeric GLOBAL | SESSION
Com_delete_multi numeric GLOBAL | SESSION
Com_do numeric GLOBAL | SESSION
Com_drop_db numeric GLOBAL | SESSION
Com_drop_event numeric GLOBAL | SESSION
Com_drop_function numeric GLOBAL | SESSION
Com_drop_index numeric GLOBAL | SESSION
Com_drop_procedure numeric GLOBAL | SESSION
Com_drop_server numeric GLOBAL | SESSION
Com_drop_table numeric GLOBAL | SESSION
Com_drop_trigger numeric GLOBAL | SESSION
Com_drop_user numeric GLOBAL | SESSION
Com_drop_view numeric GLOBAL | SESSION
Com_empty_query numeric GLOBAL | SESSION
Com_execute_sql numeric GLOBAL | SESSION
Com_flush numeric GLOBAL | SESSION
Com_get_diagnostics numeric GLOBAL | SESSION
Com_grant numeric GLOBAL | SESSION
Com_ha_close numeric GLOBAL | SESSION
Com_ha_open numeric GLOBAL | SESSION
Com_ha_read numeric GLOBAL | SESSION
Com_help numeric GLOBAL | SESSION
Com_insert numeric GLOBAL | SESSION
Com_insert_select numeric GLOBAL | SESSION
Com_install_plugin numeric GLOBAL | SESSION
Com_kill numeric GLOBAL | SESSION
Com_load numeric GLOBAL | SESSION
Com_lock_tables numeric GLOBAL | SESSION
Com_optimize numeric GLOBAL | SESSION
Com_preload_keys numeric GLOBAL | SESSION
Com_prepare_sql numeric GLOBAL | SESSION
Com_purge numeric GLOBAL | SESSION
Com_purge_before_date numeric GLOBAL | SESSION
Com_release_savepoint numeric GLOBAL | SESSION
Com_rename_table numeric GLOBAL | SESSION
Com_rename_user numeric GLOBAL | SESSION
Com_repair numeric GLOBAL | SESSION
Com_replace numeric GLOBAL | SESSION
Com_replace_select numeric GLOBAL | SESSION
Com_reset numeric GLOBAL | SESSION
Com_resignal numeric GLOBAL | SESSION
Com_revoke numeric GLOBAL | SESSION
Com_revoke_all numeric GLOBAL | SESSION
Com_rollback numeric GLOBAL | SESSION
Com_rollback_to_savepoint numeric GLOBAL | SESSION
Com_savepoint numeric GLOBAL | SESSION
Com_select numeric GLOBAL | SESSION
Com_set_option numeric GLOBAL | SESSION
Com_show_authors numeric GLOBAL | SESSION
Com_show_binlog_events numeric GLOBAL | SESSION
Com_show_binlogs numeric GLOBAL | SESSION
Com_show_charsets numeric GLOBAL | SESSION
Com_show_collations numeric GLOBAL | SESSION
Com_show_contributors numeric GLOBAL | SESSION
Com_show_create_db numeric GLOBAL | SESSION
Com_show_create_event numeric GLOBAL | SESSION
Com_show_create_func numeric GLOBAL | SESSION
Com_show_create_proc numeric GLOBAL | SESSION
Com_show_create_table numeric GLOBAL | SESSION
Com_show_create_trigger numeric GLOBAL | SESSION
Com_show_databases numeric GLOBAL | SESSION
Com_show_engine_logs numeric GLOBAL | SESSION
Com_show_engine_mutex numeric GLOBAL | SESSION
Com_show_engine_status numeric GLOBAL | SESSION
Com_show_errors numeric GLOBAL | SESSION
Com_show_events numeric GLOBAL | SESSION
Com_show_fields numeric GLOBAL | SESSION
Com_show_function_code numeric GLOBAL | SESSION
Com_show_function_status numeric GLOBAL | SESSION
Com_show_grants numeric GLOBAL | SESSION
Com_show_keys numeric GLOBAL | SESSION
Com_show_master_status numeric GLOBAL | SESSION
Com_show_new_master numeric GLOBAL | SESSION
Com_show_open_tables numeric GLOBAL | SESSION
Com_show_plugins numeric GLOBAL | SESSION
Com_show_privileges numeric GLOBAL | SESSION
Com_show_procedure_code numeric GLOBAL | SESSION
Com_show_procedure_status numeric GLOBAL | SESSION
Com_show_processlist numeric GLOBAL | SESSION
Com_show_profile numeric GLOBAL | SESSION
Com_show_profiles numeric GLOBAL | SESSION
Com_show_relaylog_events numeric GLOBAL | SESSION
Com_show_slave_hosts numeric GLOBAL | SESSION
Com_show_slave_status numeric GLOBAL | SESSION
Com_show_status numeric GLOBAL | SESSION
Com_show_storage_engines numeric GLOBAL | SESSION
Com_show_table_status numeric GLOBAL | SESSION
Com_show_tables numeric GLOBAL | SESSION
Com_show_triggers numeric GLOBAL | SESSION
Com_show_variables numeric GLOBAL | SESSION
Com_show_warnings numeric GLOBAL | SESSION
Com_signal numeric GLOBAL | SESSION
Com_slave_start numeric GLOBAL | SESSION
Com_slave_stop numeric GLOBAL | SESSION
Com_stmt_close numeric GLOBAL | SESSION
Com_stmt_execute numeric GLOBAL | SESSION
Com_stmt_fetch numeric GLOBAL | SESSION
Com_stmt_prepare numeric GLOBAL | SESSION
Com_stmt_reprepare numeric GLOBAL | SESSION
Com_stmt_reset numeric GLOBAL | SESSION
Com_stmt_send_long_data numeric GLOBAL | SESSION
Com_truncate numeric GLOBAL | SESSION
Com_uninstall_plugin numeric GLOBAL | SESSION
Com_unlock_tables numeric GLOBAL | SESSION
Com_update numeric GLOBAL | SESSION
Com_update_multi numeric GLOBAL | SESSION
Com_xa_commit numeric GLOBAL | SESSION
Com_xa_end numeric GLOBAL | SESSION
Com_xa_prepare numeric GLOBAL | SESSION
Com_xa_recover numeric GLOBAL | SESSION
Com_xa_rollback numeric GLOBAL | SESSION
Com_xa_start numeric GLOBAL | SESSION
Compression numeric SESSION
Connection_errors_accept numeric GLOBAL
Connection_errors_internal numeric GLOBAL
Connection_errors_max_connections numeric GLOBAL
Connection_errors_peer_addr numeric GLOBAL
Connection_errors_select numeric GLOBAL
Connection_errors_tcpwrap numeric GLOBAL
Connections numeric GLOBAL
Created_tmp_disk_tables numeric GLOBAL | SESSION
Created_tmp_files numeric GLOBAL
Created_tmp_tables numeric GLOBAL | SESSION
Delayed_errors numeric GLOBAL
Delayed_insert_threads numeric GLOBAL
Delayed_writes numeric GLOBAL
Flush_commands numeric GLOBAL
Handler_commit numeric GLOBAL | SESSION
Handler_delete numeric GLOBAL | SESSION
Handler_discover numeric GLOBAL | SESSION
Handler_external_lock numeric GLOBAL | SESSION
Handler_mrr_init numeric GLOBAL | SESSION
Handler_prepare numeric GLOBAL | SESSION
Handler_read_first numeric GLOBAL | SESSION
Handler_read_key numeric GLOBAL | SESSION
Handler_read_last numeric GLOBAL | SESSION
Handler_read_next numeric GLOBAL | SESSION
Handler_read_prev numeric GLOBAL | SESSION
Handler_read_rnd numeric GLOBAL | SESSION
Handler_read_rnd_next numeric GLOBAL | SESSION
Handler_rollback numeric GLOBAL | SESSION
Handler_savepoint numeric GLOBAL | SESSION
Handler_savepoint_rollback numeric GLOBAL | SESSION
Handler_update numeric GLOBAL | SESSION
Handler_write numeric GLOBAL | SESSION
Innodb_available_undo_logs numeric GLOBAL
Innodb_buffer_pool_bytes_data numeric GLOBAL
Innodb_buffer_pool_bytes_dirty numeric GLOBAL
Innodb_buffer_pool_dump_status numeric GLOBAL
Innodb_buffer_pool_load_status numeric GLOBAL
Innodb_buffer_pool_pages_data numeric GLOBAL
Innodb_buffer_pool_pages_dirty numeric GLOBAL
Innodb_buffer_pool_pages_flushed numeric GLOBAL
Innodb_buffer_pool_pages_free numeric GLOBAL
Innodb_buffer_pool_pages_latched numeric GLOBAL
Innodb_buffer_pool_pages_misc numeric GLOBAL
Innodb_buffer_pool_pages_total numeric GLOBAL
Innodb_buffer_pool_read_ahead numeric GLOBAL
Innodb_buffer_pool_read_ahead_evicted numeric GLOBAL
Innodb_buffer_pool_read_requests numeric GLOBAL
Innodb_buffer_pool_reads numeric GLOBAL
Innodb_buffer_pool_wait_free numeric GLOBAL
Innodb_buffer_pool_write_requests numeric GLOBAL
Innodb_data_fsyncs numeric GLOBAL
Innodb_data_pending_fsyncs numeric GLOBAL
Innodb_data_pending_reads numeric GLOBAL
Innodb_data_pending_writes numeric GLOBAL
Innodb_data_read numeric GLOBAL
Innodb_data_reads numeric GLOBAL
Innodb_data_writes numeric GLOBAL
Innodb_data_written numeric GLOBAL
Innodb_dblwr_pages_written numeric GLOBAL
Innodb_dblwr_writes numeric GLOBAL
Innodb_have_atomic_builtins numeric GLOBAL
Innodb_log_waits numeric GLOBAL
Innodb_log_write_requests numeric GLOBAL
Innodb_log_writes numeric GLOBAL
Innodb_num_open_files numeric GLOBAL
Innodb_os_log_fsyncs numeric GLOBAL
Innodb_os_log_pending_fsyncs numeric GLOBAL
Innodb_os_log_pending_writes numeric GLOBAL
Innodb_os_log_written numeric GLOBAL
Innodb_page_size numeric GLOBAL
Innodb_pages_created numeric GLOBAL
Innodb_pages_read numeric GLOBAL
Innodb_pages_written numeric GLOBAL
Innodb_row_lock_current_waits numeric GLOBAL
Innodb_row_lock_time numeric GLOBAL
Innodb_row_lock_time_avg numeric GLOBAL
Innodb_row_lock_time_max numeric GLOBAL
Innodb_row_lock_waits numeric GLOBAL
Innodb_rows_deleted numeric GLOBAL
Innodb_rows_inserted numeric GLOBAL
Innodb_rows_read numeric GLOBAL
Innodb_rows_updated numeric GLOBAL
Innodb_truncated_status_writes numeric GLOBAL
Key_blocks_not_flushed numeric GLOBAL
Key_blocks_unused numeric GLOBAL
Key_blocks_used numeric GLOBAL
Key_read_requests numeric GLOBAL
Key_reads numeric GLOBAL
Key_write_requests numeric GLOBAL
Key_writes numeric GLOBAL
Last_query_cost numeric SESSION
Last_query_partial_plans numeric SESSION
Max_used_connections numeric GLOBAL
Ndb_conflict_fn_max numeric GLOBAL
Ndb_conflict_fn_old numeric GLOBAL
Ndb_number_of_data_nodes numeric GLOBAL
Not_flushed_delayed_rows numeric GLOBAL
Open_files numeric GLOBAL
Open_streams numeric GLOBAL
Open_table_definitions numeric GLOBAL
Open_tables numeric GLOBAL | SESSION
Opened_files numeric GLOBAL
Opened_table_definitions numeric GLOBAL | SESSION
Opened_tables numeric GLOBAL | SESSION
Performance_schema_accounts_lost numeric GLOBAL
Performance_schema_cond_classes_lost numeric GLOBAL
Performance_schema_cond_instances_lost numeric GLOBAL
Performance_schema_file_classes_lost numeric GLOBAL
Performance_schema_file_handles_lost numeric GLOBAL
Performance_schema_file_instances_lost numeric GLOBAL
Performance_schema_hosts_lost numeric GLOBAL
Performance_schema_locker_lost numeric GLOBAL
Performance_schema_mutex_classes_lost numeric GLOBAL
Performance_schema_mutex_instances_lost numeric GLOBAL
Performance_schema_rwlock_classes_lost numeric GLOBAL
Performance_schema_rwlock_instances_lost numeric GLOBAL
Performance_schema_session_connect_attrs_lost numeric GLOBAL
Performance_schema_socket_classes_lost numeric GLOBAL
Performance_schema_socket_instances_lost numeric GLOBAL
Performance_schema_stage_classes_lost numeric GLOBAL
Performance_schema_statement_classes_lost numeric GLOBAL
Performance_schema_table_handles_lost numeric GLOBAL
Performance_schema_table_instances_lost numeric GLOBAL
Performance_schema_thread_classes_lost numeric GLOBAL
Performance_schema_thread_instances_lost numeric GLOBAL
Performance_schema_users_lost numeric GLOBAL
Prepared_stmt_count numeric GLOBAL
Qcache_free_blocks numeric GLOBAL
Qcache_free_memory numeric GLOBAL
Qcache_hits numeric GLOBAL
Qcache_inserts numeric GLOBAL
Qcache_lowmem_prunes numeric GLOBAL
Qcache_not_cached numeric GLOBAL
Qcache_queries_in_cache numeric GLOBAL
Qcache_total_blocks numeric GLOBAL
Queries numeric GLOBAL | SESSION
Questions numeric GLOBAL | SESSION
Rpl_semi_sync_master_clients numeric GLOBAL
Rpl_semi_sync_master_net_avg_wait_time numeric GLOBAL
Rpl_semi_sync_master_net_wait_time numeric GLOBAL
Rpl_semi_sync_master_net_waits numeric GLOBAL
Rpl_semi_sync_master_no_times numeric GLOBAL
Rpl_semi_sync_master_no_tx numeric GLOBAL
Rpl_semi_sync_master_status boolean GLOBAL
Rpl_semi_sync_master_timefunc_failures numeric GLOBAL
Rpl_semi_sync_master_tx_avg_wait_time numeric GLOBAL
Rpl_semi_sync_master_tx_wait_time numeric GLOBAL
Rpl_semi_sync_master_tx_waits numeric GLOBAL
Rpl_semi_sync_master_wait_pos_backtraverse numeric GLOBAL
Rpl_semi_sync_master_wait_sessions numeric GLOBAL
Rpl_semi_sync_master_yes_tx numeric GLOBAL
Rpl_semi_sync_slave_status boolean GLOBAL
Rsa_public_key string GLOBAL
Select_full_join numeric GLOBAL | SESSION
Select_full_range_join numeric GLOBAL | SESSION
Select_range numeric GLOBAL | SESSION
Select_range_check numeric GLOBAL | SESSION
Select_scan numeric GLOBAL | SESSION
Slave_heartbeat_period GLOBAL
Slave_last_heartbeat GLOBAL
Slave_open_temp_tables numeric GLOBAL
Slave_received_heartbeats GLOBAL
Slave_retried_transactions numeric GLOBAL
Slave_running boolean GLOBAL
Slow_launch_threads numeric GLOBAL | SESSION
Slow_queries numeric GLOBAL | SESSION
Sort_merge_passes numeric GLOBAL | SESSION
Sort_range numeric GLOBAL | SESSION
Sort_rows numeric GLOBAL | SESSION
Sort_scan numeric GLOBAL | SESSION
Ssl_accept_renegotiates numeric GLOBAL
Ssl_accepts numeric GLOBAL
Ssl_callback_cache_hits numeric GLOBAL
Ssl_cipher string GLOBAL | SESSION
Ssl_cipher_list string GLOBAL | SESSION
Ssl_client_connects numeric GLOBAL
Ssl_connect_renegotiates numeric GLOBAL
Ssl_ctx_verify_depth numeric GLOBAL
Ssl_ctx_verify_mode numeric GLOBAL
Ssl_default_timeout numeric GLOBAL | SESSION
Ssl_finished_accepts numeric GLOBAL
Ssl_finished_connects numeric GLOBAL
Ssl_server_not_after numeric GLOBAL | SESSION
Ssl_server_not_before numeric GLOBAL | SESSION
Ssl_session_cache_hits numeric GLOBAL
Ssl_session_cache_misses numeric GLOBAL
Ssl_session_cache_mode string GLOBAL
Ssl_session_cache_overflows numeric GLOBAL
Ssl_session_cache_size numeric GLOBAL
Ssl_session_cache_timeouts numeric GLOBAL
Ssl_sessions_reused numeric GLOBAL | SESSION
Ssl_used_session_cache_entries numeric GLOBAL
Ssl_verify_depth numeric GLOBAL | SESSION
Ssl_verify_mode numeric GLOBAL | SESSION
Ssl_version string GLOBAL | SESSION
Table_locks_immediate numeric GLOBAL
Table_locks_waited numeric GLOBAL
Table_open_cache_hits numeric GLOBAL | SESSION
Table_open_cache_misses numeric GLOBAL | SESSION
Table_open_cache_overflows numeric GLOBAL | SESSION
Tc_log_max_pages_used numeric GLOBAL
Tc_log_page_size numeric GLOBAL
Tc_log_page_waits numeric GLOBAL
Threads_cached numeric GLOBAL
Threads_connected numeric GLOBAL
Threads_created numeric GLOBAL
Threads_running numeric GLOBAL
Uptime numeric GLOBAL
Uptime_since_flush_status numeric GLOBAL

The status variables have the following meanings.




Spec-Zone.ru - all specs in one place