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.36, “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 NameVariable TypeVariable Scope
Aborted_clientsnumericGLOBAL
Aborted_connectsnumericGLOBAL
Binlog_cache_disk_usenumericGLOBAL
Binlog_cache_usenumericGLOBAL
Binlog_stmt_cache_disk_usenumericGLOBAL
Binlog_stmt_cache_usenumericGLOBAL
Bytes_receivednumericGLOBAL | SESSION
Bytes_sentnumericGLOBAL | SESSION
Com_admin_commandsnumericGLOBAL | SESSION
Com_alter_dbnumericGLOBAL | SESSION
Com_alter_db_upgradenumericGLOBAL | SESSION
Com_alter_eventnumericGLOBAL | SESSION
Com_alter_functionnumericGLOBAL | SESSION
Com_alter_procedurenumericGLOBAL | SESSION
Com_alter_servernumericGLOBAL | SESSION
Com_alter_tablenumericGLOBAL | SESSION
Com_alter_tablespacenumericGLOBAL | SESSION
Com_analyzenumericGLOBAL | SESSION
Com_assign_to_keycachenumericGLOBAL | SESSION
Com_beginnumericGLOBAL | SESSION
Com_binlognumericGLOBAL | SESSION
Com_call_procedurenumericGLOBAL | SESSION
Com_change_dbnumericGLOBAL | SESSION
Com_change_masternumericGLOBAL | SESSION
Com_checknumericGLOBAL | SESSION
Com_checksumnumericGLOBAL | SESSION
Com_commitnumericGLOBAL | SESSION
Com_create_dbnumericGLOBAL | SESSION
Com_create_eventnumericGLOBAL | SESSION
Com_create_functionnumericGLOBAL | SESSION
Com_create_indexnumericGLOBAL | SESSION
Com_create_procedurenumericGLOBAL | SESSION
Com_create_servernumericGLOBAL | SESSION
Com_create_tablenumericGLOBAL | SESSION
Com_create_triggernumericGLOBAL | SESSION
Com_create_udfnumericGLOBAL | SESSION
Com_create_usernumericGLOBAL | SESSION
Com_create_viewnumericGLOBAL | SESSION
Com_dealloc_sqlnumericGLOBAL | SESSION
Com_deletenumericGLOBAL | SESSION
Com_delete_multinumericGLOBAL | SESSION
Com_donumericGLOBAL | SESSION
Com_drop_dbnumericGLOBAL | SESSION
Com_drop_eventnumericGLOBAL | SESSION
Com_drop_functionnumericGLOBAL | SESSION
Com_drop_indexnumericGLOBAL | SESSION
Com_drop_procedurenumericGLOBAL | SESSION
Com_drop_servernumericGLOBAL | SESSION
Com_drop_tablenumericGLOBAL | SESSION
Com_drop_triggernumericGLOBAL | SESSION
Com_drop_usernumericGLOBAL | SESSION
Com_drop_viewnumericGLOBAL | SESSION
Com_empty_querynumericGLOBAL | SESSION
Com_execute_sqlnumericGLOBAL | SESSION
Com_flushnumericGLOBAL | SESSION
Com_grantnumericGLOBAL | SESSION
Com_ha_closenumericGLOBAL | SESSION
Com_ha_opennumericGLOBAL | SESSION
Com_ha_readnumericGLOBAL | SESSION
Com_helpnumericGLOBAL | SESSION
Com_insertnumericGLOBAL | SESSION
Com_insert_selectnumericGLOBAL | SESSION
Com_install_pluginnumericGLOBAL | SESSION
Com_killnumericGLOBAL | SESSION
Com_loadnumericGLOBAL | SESSION
Com_lock_tablesnumericGLOBAL | SESSION
Com_optimizenumericGLOBAL | SESSION
Com_preload_keysnumericGLOBAL | SESSION
Com_prepare_sqlnumericGLOBAL | SESSION
Com_purgenumericGLOBAL | SESSION
Com_purge_before_datenumericGLOBAL | SESSION
Com_release_savepointnumericGLOBAL | SESSION
Com_rename_tablenumericGLOBAL | SESSION
Com_rename_usernumericGLOBAL | SESSION
Com_repairnumericGLOBAL | SESSION
Com_replacenumericGLOBAL | SESSION
Com_replace_selectnumericGLOBAL | SESSION
Com_resetnumericGLOBAL | SESSION
Com_resignalnumericGLOBAL | SESSION
Com_revokenumericGLOBAL | SESSION
Com_revoke_allnumericGLOBAL | SESSION
Com_rollbacknumericGLOBAL | SESSION
Com_rollback_to_savepointnumericGLOBAL | SESSION
Com_savepointnumericGLOBAL | SESSION
Com_selectnumericGLOBAL | SESSION
Com_set_optionnumericGLOBAL | SESSION
Com_show_authorsnumericGLOBAL | SESSION
Com_show_binlog_eventsnumericGLOBAL | SESSION
Com_show_binlogsnumericGLOBAL | SESSION
Com_show_charsetsnumericGLOBAL | SESSION
Com_show_collationsnumericGLOBAL | SESSION
Com_show_contributorsnumericGLOBAL | SESSION
Com_show_create_dbnumericGLOBAL | SESSION
Com_show_create_eventnumericGLOBAL | SESSION
Com_show_create_funcnumericGLOBAL | SESSION
Com_show_create_procnumericGLOBAL | SESSION
Com_show_create_tablenumericGLOBAL | SESSION
Com_show_create_triggernumericGLOBAL | SESSION
Com_show_databasesnumericGLOBAL | SESSION
Com_show_engine_logsnumericGLOBAL | SESSION
Com_show_engine_mutexnumericGLOBAL | SESSION
Com_show_engine_statusnumericGLOBAL | SESSION
Com_show_errorsnumericGLOBAL | SESSION
Com_show_eventsnumericGLOBAL | SESSION
Com_show_fieldsnumericGLOBAL | SESSION
Com_show_function_codenumericGLOBAL | SESSION
Com_show_function_statusnumericGLOBAL | SESSION
Com_show_grantsnumericGLOBAL | SESSION
Com_show_keysnumericGLOBAL | SESSION
Com_show_master_statusnumericGLOBAL | SESSION
Com_show_ndb_statusnumericGLOBAL | SESSION
Com_show_new_masternumericGLOBAL | SESSION
Com_show_open_tablesnumericGLOBAL | SESSION
Com_show_pluginsnumericGLOBAL | SESSION
Com_show_privilegesnumericGLOBAL | SESSION
Com_show_procedure_codenumericGLOBAL | SESSION
Com_show_procedure_statusnumericGLOBAL | SESSION
Com_show_processlistnumericGLOBAL | SESSION
Com_show_profilenumericGLOBAL | SESSION
Com_show_profilesnumericGLOBAL | SESSION
Com_show_relaylog_eventsnumericGLOBAL | SESSION
Com_show_slave_hostsnumericGLOBAL | SESSION
Com_show_slave_statusnumericGLOBAL | SESSION
Com_show_statusnumericGLOBAL | SESSION
Com_show_storage_enginesnumericGLOBAL | SESSION
Com_show_table_statusnumericGLOBAL | SESSION
Com_show_tablesnumericGLOBAL | SESSION
Com_show_triggersnumericGLOBAL | SESSION
Com_show_variablesnumericGLOBAL | SESSION
Com_show_warningsnumericGLOBAL | SESSION
Com_signalnumericGLOBAL | SESSION
Com_slave_startnumericGLOBAL | SESSION
Com_slave_stopnumericGLOBAL | SESSION
Com_stmt_closenumericGLOBAL | SESSION
Com_stmt_executenumericGLOBAL | SESSION
Com_stmt_fetchnumericGLOBAL | SESSION
Com_stmt_preparenumericGLOBAL | SESSION
Com_stmt_repreparenumericGLOBAL | SESSION
Com_stmt_resetnumericGLOBAL | SESSION
Com_stmt_send_long_datanumericGLOBAL | SESSION
Com_truncatenumericGLOBAL | SESSION
Com_uninstall_pluginnumericGLOBAL | SESSION
Com_unlock_tablesnumericGLOBAL | SESSION
Com_updatenumericGLOBAL | SESSION
Com_update_multinumericGLOBAL | SESSION
Com_xa_commitnumericGLOBAL | SESSION
Com_xa_endnumericGLOBAL | SESSION
Com_xa_preparenumericGLOBAL | SESSION
Com_xa_recovernumericGLOBAL | SESSION
Com_xa_rollbacknumericGLOBAL | SESSION
Com_xa_startnumericGLOBAL | SESSION
CompressionnumericSESSION
ConnectionsnumericGLOBAL
Created_tmp_disk_tablesnumericGLOBAL | SESSION
Created_tmp_filesnumericGLOBAL
Created_tmp_tablesnumericGLOBAL | SESSION
Delayed_errorsnumericGLOBAL
Delayed_insert_threadsnumericGLOBAL
Delayed_writesnumericGLOBAL
Flush_commandsnumericGLOBAL
Handler_commitnumericGLOBAL | SESSION
Handler_deletenumericGLOBAL | SESSION
Handler_discovernumericGLOBAL | SESSION
Handler_preparenumericGLOBAL | SESSION
Handler_read_firstnumericGLOBAL | SESSION
Handler_read_keynumericGLOBAL | SESSION
Handler_read_lastnumericGLOBAL | SESSION
Handler_read_nextnumericGLOBAL | SESSION
Handler_read_prevnumericGLOBAL | SESSION
Handler_read_rndnumericGLOBAL | SESSION
Handler_read_rnd_nextnumericGLOBAL | SESSION
Handler_rollbacknumericGLOBAL | SESSION
Handler_savepointnumericGLOBAL | SESSION
Handler_savepoint_rollbacknumericGLOBAL | SESSION
Handler_updatenumericGLOBAL | SESSION
Handler_writenumericGLOBAL | SESSION
Innodb_buffer_pool_bytes_datanumericGLOBAL
Innodb_buffer_pool_bytes_dirtynumericGLOBAL
Innodb_buffer_pool_pages_datanumericGLOBAL
Innodb_buffer_pool_pages_dirtynumericGLOBAL
Innodb_buffer_pool_pages_flushednumericGLOBAL
Innodb_buffer_pool_pages_freenumericGLOBAL
Innodb_buffer_pool_pages_latchednumericGLOBAL
Innodb_buffer_pool_pages_miscnumericGLOBAL
Innodb_buffer_pool_pages_totalnumericGLOBAL
Innodb_buffer_pool_read_aheadnumericGLOBAL
Innodb_buffer_pool_read_ahead_evictednumericGLOBAL
Innodb_buffer_pool_read_requestsnumericGLOBAL
Innodb_buffer_pool_readsnumericGLOBAL
Innodb_buffer_pool_wait_freenumericGLOBAL
Innodb_buffer_pool_write_requestsnumericGLOBAL
Innodb_data_fsyncsnumericGLOBAL
Innodb_data_pending_fsyncsnumericGLOBAL
Innodb_data_pending_readsnumericGLOBAL
Innodb_data_pending_writesnumericGLOBAL
Innodb_data_readnumericGLOBAL
Innodb_data_readsnumericGLOBAL
Innodb_data_writesnumericGLOBAL
Innodb_data_writtennumericGLOBAL
Innodb_dblwr_pages_writtennumericGLOBAL
Innodb_dblwr_writesnumericGLOBAL
Innodb_have_atomic_builtinsnumericGLOBAL
Innodb_log_waitsnumericGLOBAL
Innodb_log_write_requestsnumericGLOBAL
Innodb_log_writesnumericGLOBAL
Innodb_os_log_fsyncsnumericGLOBAL
Innodb_os_log_pending_fsyncsnumericGLOBAL
Innodb_os_log_pending_writesnumericGLOBAL
Innodb_os_log_writtennumericGLOBAL
Innodb_page_sizenumericGLOBAL
Innodb_pages_creatednumericGLOBAL
Innodb_pages_readnumericGLOBAL
Innodb_pages_writtennumericGLOBAL
Innodb_row_lock_current_waitsnumericGLOBAL
Innodb_row_lock_timenumericGLOBAL
Innodb_row_lock_time_avgnumericGLOBAL
Innodb_row_lock_time_maxnumericGLOBAL
Innodb_row_lock_waitsnumericGLOBAL
Innodb_rows_deletednumericGLOBAL
Innodb_rows_insertednumericGLOBAL
Innodb_rows_readnumericGLOBAL
Innodb_rows_updatednumericGLOBAL
Innodb_truncated_status_writesnumericGLOBAL
Key_blocks_not_flushednumericGLOBAL
Key_blocks_unusednumericGLOBAL
Key_blocks_usednumericGLOBAL
Key_read_requestsnumericGLOBAL
Key_readsnumericGLOBAL
Key_write_requestsnumericGLOBAL
Key_writesnumericGLOBAL
Last_query_costnumericSESSION
Max_used_connectionsnumericGLOBAL
Ndb_api_bytes_received_countnumericGLOBAL
Ndb_api_bytes_received_count_sessionnumericSESSION
Ndb_api_bytes_received_count_slavenumericGLOBAL
Ndb_api_bytes_sent_countnumericGLOBAL
Ndb_api_bytes_sent_count_sessionnumericSESSION
Ndb_api_bytes_sent_count_slavenumericGLOBAL
Ndb_api_event_bytes_countnumericGLOBAL
Ndb_api_event_bytes_count_injectornumericGLOBAL
Ndb_api_event_data_countnumericGLOBAL
Ndb_api_event_data_count_injectornumericGLOBAL
Ndb_api_event_nondata_countnumericGLOBAL
Ndb_api_event_nondata_count_injectornumericGLOBAL
Ndb_api_pk_op_countnumericGLOBAL
Ndb_api_pk_op_count_sessionnumericSESSION
Ndb_api_pk_op_count_slavenumericGLOBAL
Ndb_api_pruned_scan_countnumericGLOBAL
Ndb_api_pruned_scan_count_sessionnumericSESSION
Ndb_api_pruned_scan_count_slavenumericGLOBAL
Ndb_api_range_scan_countnumericGLOBAL
Ndb_api_range_scan_count_sessionnumericSESSION
Ndb_api_range_scan_count_slavenumericGLOBAL
Ndb_api_read_row_countnumericGLOBAL
Ndb_api_read_row_count_sessionnumericSESSION
Ndb_api_read_row_count_slavenumericGLOBAL
Ndb_api_scan_batch_countnumericGLOBAL
Ndb_api_scan_batch_count_sessionnumericSESSION
Ndb_api_scan_batch_count_slavenumericGLOBAL
Ndb_api_table_scan_countnumericGLOBAL
Ndb_api_table_scan_count_sessionnumericSESSION
Ndb_api_table_scan_count_slavenumericGLOBAL
Ndb_api_trans_abort_countnumericGLOBAL
Ndb_api_trans_abort_count_sessionnumericSESSION
Ndb_api_trans_abort_count_slavenumericGLOBAL
Ndb_api_trans_close_countnumericGLOBAL
Ndb_api_trans_close_count_sessionnumericSESSION
Ndb_api_trans_close_count_slavenumericGLOBAL
Ndb_api_trans_commit_countnumericGLOBAL
Ndb_api_trans_commit_count_sessionnumericSESSION
Ndb_api_trans_commit_count_slavenumericGLOBAL
Ndb_api_trans_local_read_row_countnumericGLOBAL
Ndb_api_trans_local_read_row_count_sessionnumericSESSION
Ndb_api_trans_local_read_row_count_slavenumericGLOBAL
Ndb_api_trans_start_countnumericGLOBAL
Ndb_api_trans_start_count_sessionnumericSESSION
Ndb_api_trans_start_count_slavenumericGLOBAL
Ndb_api_uk_op_countnumericGLOBAL
Ndb_api_uk_op_count_sessionnumericSESSION
Ndb_api_uk_op_count_slavenumericGLOBAL
Ndb_api_wait_exec_complete_countnumericGLOBAL
Ndb_api_wait_exec_complete_count_sessionnumericSESSION
Ndb_api_wait_exec_complete_count_slavenumericGLOBAL
Ndb_api_wait_meta_request_countnumericGLOBAL
Ndb_api_wait_meta_request_count_sessionnumericSESSION
Ndb_api_wait_meta_request_count_slavenumericGLOBAL
Ndb_api_wait_nanos_countnumericGLOBAL
Ndb_api_wait_nanos_count_sessionnumericSESSION
Ndb_api_wait_nanos_count_slavenumericGLOBAL
Ndb_api_wait_scan_result_countnumericGLOBAL
Ndb_api_wait_scan_result_count_sessionnumericSESSION
Ndb_api_wait_scan_result_count_slavenumericGLOBAL
ndb_cluster_connection_poolnumericGLOBAL
Ndb_cluster_node_idnumericGLOBAL | SESSION
Ndb_config_from_hostnumericGLOBAL | SESSION
Ndb_config_from_portnumericGLOBAL | SESSION
Ndb_conflict_fn_epochnumericGLOBAL
Ndb_conflict_fn_epoch_transnumericGLOBAL
Ndb_conflict_fn_maxnumericGLOBAL
Ndb_conflict_fn_oldnumericGLOBAL
Ndb_conflict_trans_conflict_commit_countnumericGLOBAL
Ndb_conflict_trans_detect_iter_countnumericGLOBAL
Ndb_conflict_trans_reject_countnumericGLOBAL
Ndb_conflict_trans_row_conflict_countnumericGLOBAL
Ndb_conflict_trans_row_reject_countnumericGLOBAL
ndb_execute_countnumericGLOBAL
ndb-nodeidnumericGLOBAL
Ndb_number_of_data_nodesnumericGLOBAL
ndb_pruned_scan_countnumericGLOBAL
Ndb_pushed_queries_definednumericGLOBAL
Ndb_pushed_queries_droppednumericGLOBAL
Ndb_pushed_queries_executednumericGLOBAL
ndb_pushed_readsnumericGLOBAL
ndb_scan_countnumericGLOBAL
Not_flushed_delayed_rowsnumericGLOBAL
Open_filesnumericGLOBAL
Open_streamsnumericGLOBAL
Open_table_definitionsnumericGLOBAL
Open_tablesnumericGLOBAL | SESSION
Opened_filesnumericGLOBAL
Opened_table_definitionsnumericGLOBAL | SESSION
Opened_tablesnumericGLOBAL | SESSION
Performance_schema_cond_classes_lostnumericGLOBAL
Performance_schema_cond_instances_lostnumericGLOBAL
Performance_schema_file_classes_lostnumericGLOBAL
Performance_schema_file_handles_lostnumericGLOBAL
Performance_schema_file_instances_lostnumericGLOBAL
Performance_schema_locker_lostnumericGLOBAL
Performance_schema_mutex_classes_lostnumericGLOBAL
Performance_schema_mutex_instances_lostnumericGLOBAL
Performance_schema_rwlock_classes_lostnumericGLOBAL
Performance_schema_rwlock_instances_lostnumericGLOBAL
Performance_schema_table_handles_lostnumericGLOBAL
Performance_schema_table_instances_lostnumericGLOBAL
Performance_schema_thread_classes_lostnumericGLOBAL
Performance_schema_thread_instances_lostnumericGLOBAL
Prepared_stmt_countnumericGLOBAL
Qcache_free_blocksnumericGLOBAL
Qcache_free_memorynumericGLOBAL
Qcache_hitsnumericGLOBAL
Qcache_insertsnumericGLOBAL
Qcache_lowmem_prunesnumericGLOBAL
Qcache_not_cachednumericGLOBAL
Qcache_queries_in_cachenumericGLOBAL
Qcache_total_blocksnumericGLOBAL
QueriesnumericGLOBAL | SESSION
QuestionsnumericGLOBAL | SESSION
Rpl_semi_sync_master_clientsnumericGLOBAL
Rpl_semi_sync_master_net_avg_wait_timenumericGLOBAL
Rpl_semi_sync_master_net_wait_timenumericGLOBAL
Rpl_semi_sync_master_net_waitsnumericGLOBAL
Rpl_semi_sync_master_no_timesnumericGLOBAL
Rpl_semi_sync_master_no_txnumericGLOBAL
Rpl_semi_sync_master_statusbooleanGLOBAL
Rpl_semi_sync_master_timefunc_failuresnumericGLOBAL
Rpl_semi_sync_master_tx_avg_wait_timenumericGLOBAL
Rpl_semi_sync_master_tx_wait_timenumericGLOBAL
Rpl_semi_sync_master_tx_waitsnumericGLOBAL
Rpl_semi_sync_master_wait_pos_backtraversenumericGLOBAL
Rpl_semi_sync_master_wait_sessionsnumericGLOBAL
Rpl_semi_sync_master_yes_txnumericGLOBAL
Rpl_semi_sync_slave_statusbooleanGLOBAL
Rpl_statusstringGLOBAL
Select_full_joinnumericGLOBAL | SESSION
Select_full_range_joinnumericGLOBAL | SESSION
Select_rangenumericGLOBAL | SESSION
Select_range_checknumericGLOBAL | SESSION
Select_scannumericGLOBAL | SESSION
Slave_heartbeat_period GLOBAL
Slave_open_temp_tablesnumericGLOBAL
Slave_received_heartbeats GLOBAL
Slave_retried_transactionsnumericGLOBAL
Slave_runningbooleanGLOBAL
Slow_launch_threadsnumericGLOBAL | SESSION
Slow_queriesnumericGLOBAL | SESSION
Sort_merge_passesnumericGLOBAL | SESSION
Sort_rangenumericGLOBAL | SESSION
Sort_rowsnumericGLOBAL | SESSION
Sort_scannumericGLOBAL | SESSION
Ssl_accept_renegotiatesnumericGLOBAL
Ssl_acceptsnumericGLOBAL
Ssl_callback_cache_hitsnumericGLOBAL
Ssl_cipherstringGLOBAL | SESSION
Ssl_cipher_liststringGLOBAL | SESSION
Ssl_client_connectsnumericGLOBAL
Ssl_connect_renegotiatesnumericGLOBAL
Ssl_ctx_verify_depthnumericGLOBAL
Ssl_ctx_verify_modenumericGLOBAL
Ssl_default_timeoutnumericGLOBAL | SESSION
Ssl_finished_acceptsnumericGLOBAL
Ssl_finished_connectsnumericGLOBAL
Ssl_session_cache_hitsnumericGLOBAL
Ssl_session_cache_missesnumericGLOBAL
Ssl_session_cache_modestringGLOBAL
Ssl_session_cache_overflowsnumericGLOBAL
Ssl_session_cache_sizenumericGLOBAL
Ssl_session_cache_timeoutsnumericGLOBAL
Ssl_sessions_reusednumericGLOBAL | SESSION
Ssl_used_session_cache_entriesnumericGLOBAL
Ssl_verify_depthnumericGLOBAL | SESSION
Ssl_verify_modenumericGLOBAL | SESSION
Ssl_versionstringGLOBAL | SESSION
Table_locks_immediatenumericGLOBAL
Table_locks_waitednumericGLOBAL
Tc_log_max_pages_usednumericGLOBAL
Tc_log_page_sizenumericGLOBAL
Tc_log_page_waitsnumericGLOBAL
Threads_cachednumericGLOBAL
Threads_connectednumericGLOBAL
Threads_creatednumericGLOBAL
Threads_runningnumericGLOBAL
UptimenumericGLOBAL
Uptime_since_flush_statusnumericGLOBAL

The status variables have the following meanings. For meanings of status variables specific to MySQL Cluster, see Section 17.3.4.4, “MySQL Cluster Status Variables”.