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.37, “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_clientsintegerGLOBAL
Aborted_connectsintegerGLOBAL
Binlog_cache_disk_useintegerGLOBAL
Binlog_cache_useintegerGLOBAL
Bytes_receivedintegerGLOBAL | SESSION
Bytes_sentintegerGLOBAL | SESSION
Com_admin_commandsintegerGLOBAL | SESSION
Com_alter_dbintegerGLOBAL | SESSION
Com_alter_db_upgradeintegerGLOBAL | SESSION
Com_alter_eventintegerGLOBAL | SESSION
Com_alter_functionintegerGLOBAL | SESSION
Com_alter_procedureintegerGLOBAL | SESSION
Com_alter_serverintegerGLOBAL | SESSION
Com_alter_tableintegerGLOBAL | SESSION
Com_alter_tablespaceintegerGLOBAL | SESSION
Com_analyzeintegerGLOBAL | SESSION
Com_assign_to_keycacheintegerGLOBAL | SESSION
Com_backup_tableintegerGLOBAL | SESSION
Com_beginintegerGLOBAL | SESSION
Com_binlogintegerGLOBAL | SESSION
Com_call_procedureintegerGLOBAL | SESSION
Com_change_dbintegerGLOBAL | SESSION
Com_change_masterintegerGLOBAL | SESSION
Com_checkintegerGLOBAL | SESSION
Com_checksumintegerGLOBAL | SESSION
Com_commitintegerGLOBAL | SESSION
Com_create_dbintegerGLOBAL | SESSION
Com_create_eventintegerGLOBAL | SESSION
Com_create_functionintegerGLOBAL | SESSION
Com_create_indexintegerGLOBAL | SESSION
Com_create_procedureintegerGLOBAL | SESSION
Com_create_serverintegerGLOBAL | SESSION
Com_create_tableintegerGLOBAL | SESSION
Com_create_triggerintegerGLOBAL | SESSION
Com_create_udfintegerGLOBAL | SESSION
Com_create_userintegerGLOBAL | SESSION
Com_create_viewintegerGLOBAL | SESSION
Com_dealloc_sqlintegerGLOBAL | SESSION
Com_deleteintegerGLOBAL | SESSION
Com_delete_multiintegerGLOBAL | SESSION
Com_dointegerGLOBAL | SESSION
Com_drop_dbintegerGLOBAL | SESSION
Com_drop_eventintegerGLOBAL | SESSION
Com_drop_functionintegerGLOBAL | SESSION
Com_drop_indexintegerGLOBAL | SESSION
Com_drop_procedureintegerGLOBAL | SESSION
Com_drop_serverintegerGLOBAL | SESSION
Com_drop_tableintegerGLOBAL | SESSION
Com_drop_triggerintegerGLOBAL | SESSION
Com_drop_userintegerGLOBAL | SESSION
Com_drop_viewintegerGLOBAL | SESSION
Com_empty_queryintegerGLOBAL | SESSION
Com_execute_sqlintegerGLOBAL | SESSION
Com_flushintegerGLOBAL | SESSION
Com_grantintegerGLOBAL | SESSION
Com_ha_closeintegerGLOBAL | SESSION
Com_ha_openintegerGLOBAL | SESSION
Com_ha_readintegerGLOBAL | SESSION
Com_helpintegerGLOBAL | SESSION
Com_insertintegerGLOBAL | SESSION
Com_insert_selectintegerGLOBAL | SESSION
Com_install_pluginintegerGLOBAL | SESSION
Com_killintegerGLOBAL | SESSION
Com_loadintegerGLOBAL | SESSION
Com_lock_tablesintegerGLOBAL | SESSION
Com_optimizeintegerGLOBAL | SESSION
Com_preload_keysintegerGLOBAL | SESSION
Com_prepare_sqlintegerGLOBAL | SESSION
Com_purgeintegerGLOBAL | SESSION
Com_purge_before_dateintegerGLOBAL | SESSION
Com_release_savepointintegerGLOBAL | SESSION
Com_rename_tableintegerGLOBAL | SESSION
Com_rename_userintegerGLOBAL | SESSION
Com_repairintegerGLOBAL | SESSION
Com_replaceintegerGLOBAL | SESSION
Com_replace_selectintegerGLOBAL | SESSION
Com_resetintegerGLOBAL | SESSION
Com_restore_tableintegerGLOBAL | SESSION
Com_revokeintegerGLOBAL | SESSION
Com_revoke_allintegerGLOBAL | SESSION
Com_rollbackintegerGLOBAL | SESSION
Com_rollback_to_savepointintegerGLOBAL | SESSION
Com_savepointintegerGLOBAL | SESSION
Com_selectintegerGLOBAL | SESSION
Com_set_optionintegerGLOBAL | SESSION
Com_show_authorsintegerGLOBAL | SESSION
Com_show_binlog_eventsintegerGLOBAL | SESSION
Com_show_binlogsintegerGLOBAL | SESSION
Com_show_charsetsintegerGLOBAL | SESSION
Com_show_collationsintegerGLOBAL | SESSION
Com_show_column_typesintegerGLOBAL | SESSION
Com_show_contributorsintegerGLOBAL | SESSION
Com_show_create_dbintegerGLOBAL | SESSION
Com_show_create_eventintegerGLOBAL | SESSION
Com_show_create_funcintegerGLOBAL | SESSION
Com_show_create_procintegerGLOBAL | SESSION
Com_show_create_tableintegerGLOBAL | SESSION
Com_show_create_triggerintegerGLOBAL | SESSION
Com_show_databasesintegerGLOBAL | SESSION
Com_show_engine_logsintegerGLOBAL | SESSION
Com_show_engine_mutexintegerGLOBAL | SESSION
Com_show_engine_statusintegerGLOBAL | SESSION
Com_show_errorsintegerGLOBAL | SESSION
Com_show_eventsintegerGLOBAL | SESSION
Com_show_fieldsintegerGLOBAL | SESSION
Com_show_function_codeintegerGLOBAL | SESSION
Com_show_function_statusintegerGLOBAL | SESSION
Com_show_grantsintegerGLOBAL | SESSION
Com_show_keysintegerGLOBAL | SESSION
Com_show_logsintegerGLOBAL | SESSION
Com_show_master_statusintegerGLOBAL | SESSION
Com_show_ndb_statusintegerGLOBAL | SESSION
Com_show_new_masterintegerGLOBAL | SESSION
Com_show_open_tablesintegerGLOBAL | SESSION
Com_show_pluginsintegerGLOBAL | SESSION
Com_show_privilegesintegerGLOBAL | SESSION
Com_show_procedure_codeintegerGLOBAL | SESSION
Com_show_procedure_statusintegerGLOBAL | SESSION
Com_show_processlistintegerGLOBAL | SESSION
Com_show_profileintegerGLOBAL | SESSION
Com_show_profilesintegerGLOBAL | SESSION
Com_show_slave_hostsintegerGLOBAL | SESSION
Com_show_slave_statusintegerGLOBAL | SESSION
Com_show_statusintegerGLOBAL | SESSION
Com_show_storage_enginesintegerGLOBAL | SESSION
Com_show_table_statusintegerGLOBAL | SESSION
Com_show_tablesintegerGLOBAL | SESSION
Com_show_triggersintegerGLOBAL | SESSION
Com_show_variablesintegerGLOBAL | SESSION
Com_show_warningsintegerGLOBAL | SESSION
Com_slave_startintegerGLOBAL | SESSION
Com_slave_stopintegerGLOBAL | SESSION
Com_stmt_closeintegerGLOBAL | SESSION
Com_stmt_executeintegerGLOBAL | SESSION
Com_stmt_fetchintegerGLOBAL | SESSION
Com_stmt_prepareintegerGLOBAL | SESSION
Com_stmt_reprepareintegerGLOBAL | SESSION
Com_stmt_resetintegerGLOBAL | SESSION
Com_stmt_send_long_dataintegerGLOBAL | SESSION
Com_truncateintegerGLOBAL | SESSION
Com_uninstall_pluginintegerGLOBAL | SESSION
Com_unlock_tablesintegerGLOBAL | SESSION
Com_updateintegerGLOBAL | SESSION
Com_update_multiintegerGLOBAL | SESSION
Com_xa_commitintegerGLOBAL | SESSION
Com_xa_endintegerGLOBAL | SESSION
Com_xa_prepareintegerGLOBAL | SESSION
Com_xa_recoverintegerGLOBAL | SESSION
Com_xa_rollbackintegerGLOBAL | SESSION
Com_xa_startintegerGLOBAL | SESSION
CompressionintegerSESSION
ConnectionsintegerGLOBAL
Created_tmp_disk_tablesintegerGLOBAL | SESSION
Created_tmp_filesintegerGLOBAL
Created_tmp_tablesintegerGLOBAL | SESSION
Delayed_errorsintegerGLOBAL
Delayed_insert_threadsintegerGLOBAL
Delayed_writesintegerGLOBAL
Flush_commandsintegerGLOBAL
Handler_commitintegerGLOBAL | SESSION
Handler_deleteintegerGLOBAL | SESSION
Handler_discoverintegerGLOBAL | SESSION
Handler_prepareintegerGLOBAL | SESSION
Handler_read_firstintegerGLOBAL | SESSION
Handler_read_keyintegerGLOBAL | SESSION
Handler_read_nextintegerGLOBAL | SESSION
Handler_read_previntegerGLOBAL | SESSION
Handler_read_rndintegerGLOBAL | SESSION
Handler_read_rnd_nextintegerGLOBAL | SESSION
Handler_rollbackintegerGLOBAL | SESSION
Handler_savepointintegerGLOBAL | SESSION
Handler_savepoint_rollbackintegerGLOBAL | SESSION
Handler_updateintegerGLOBAL | SESSION
Handler_writeintegerGLOBAL | SESSION
Innodb_buffer_pool_pages_dataintegerGLOBAL
Innodb_buffer_pool_pages_dirtyintegerGLOBAL
Innodb_buffer_pool_pages_flushedintegerGLOBAL
Innodb_buffer_pool_pages_freeintegerGLOBAL
Innodb_buffer_pool_pages_latchedintegerGLOBAL
Innodb_buffer_pool_pages_miscintegerGLOBAL
Innodb_buffer_pool_pages_totalintegerGLOBAL
Innodb_buffer_pool_read_aheadintegerGLOBAL
Innodb_buffer_pool_read_ahead_evictedintegerGLOBAL
Innodb_buffer_pool_read_ahead_rndintegerGLOBAL
Innodb_buffer_pool_read_ahead_seqintegerGLOBAL
Innodb_buffer_pool_read_requestsintegerGLOBAL
Innodb_buffer_pool_readsintegerGLOBAL
Innodb_buffer_pool_wait_freeintegerGLOBAL
Innodb_buffer_pool_write_requestsintegerGLOBAL
Innodb_data_fsyncsintegerGLOBAL
Innodb_data_pending_fsyncsintegerGLOBAL
Innodb_data_pending_readsintegerGLOBAL
Innodb_data_pending_writesintegerGLOBAL
Innodb_data_readintegerGLOBAL
Innodb_data_readsintegerGLOBAL
Innodb_data_writesintegerGLOBAL
Innodb_data_writtenintegerGLOBAL
Innodb_dblwr_pages_writtenintegerGLOBAL
Innodb_dblwr_writesintegerGLOBAL
Innodb_have_atomic_builtinsintegerGLOBAL
Innodb_log_waitsintegerGLOBAL
Innodb_log_write_requestsintegerGLOBAL
Innodb_log_writesintegerGLOBAL
Innodb_os_log_fsyncsintegerGLOBAL
Innodb_os_log_pending_fsyncsintegerGLOBAL
Innodb_os_log_pending_writesintegerGLOBAL
Innodb_os_log_writtenintegerGLOBAL
Innodb_page_sizeintegerGLOBAL
Innodb_pages_createdintegerGLOBAL
Innodb_pages_readintegerGLOBAL
Innodb_pages_writtenintegerGLOBAL
Innodb_row_lock_current_waitsintegerGLOBAL
Innodb_row_lock_timeintegerGLOBAL
Innodb_row_lock_time_avgintegerGLOBAL
Innodb_row_lock_time_maxintegerGLOBAL
Innodb_row_lock_waitsintegerGLOBAL
Innodb_rows_deletedintegerGLOBAL
Innodb_rows_insertedintegerGLOBAL
Innodb_rows_readintegerGLOBAL
Innodb_rows_updatedintegerGLOBAL
Key_blocks_not_flushedintegerGLOBAL
Key_blocks_unusedintegerGLOBAL
Key_blocks_usedintegerGLOBAL
Key_read_requestsintegerGLOBAL
Key_readsintegerGLOBAL
Key_write_requestsintegerGLOBAL
Key_writesintegerGLOBAL
Last_query_costnumericSESSION
Max_used_connectionsintegerGLOBAL
Ndb_api_bytes_received_countintegerGLOBAL
Ndb_api_bytes_received_count_sessionintegerSESSION
Ndb_api_bytes_received_count_slaveintegerGLOBAL
Ndb_api_bytes_sent_countintegerGLOBAL
Ndb_api_bytes_sent_count_sessionintegerSESSION
Ndb_api_bytes_sent_count_slaveintegerGLOBAL
Ndb_api_event_bytes_countintegerGLOBAL
Ndb_api_event_bytes_count_injectorintegerGLOBAL
Ndb_api_event_data_countintegerGLOBAL
Ndb_api_event_data_count_injectorintegerGLOBAL
Ndb_api_event_nondata_countintegerGLOBAL
Ndb_api_event_nondata_count_injectorintegerGLOBAL
Ndb_api_pk_op_countintegerGLOBAL
Ndb_api_pk_op_count_sessionintegerSESSION
Ndb_api_pk_op_count_slaveintegerGLOBAL
Ndb_api_pruned_scan_countintegerGLOBAL
Ndb_api_pruned_scan_count_sessionintegerSESSION
Ndb_api_pruned_scan_count_slaveintegerGLOBAL
Ndb_api_range_scan_countintegerGLOBAL
Ndb_api_range_scan_count_sessionintegerSESSION
Ndb_api_range_scan_count_slaveintegerGLOBAL
Ndb_api_read_row_countintegerGLOBAL
Ndb_api_read_row_count_sessionintegerSESSION
Ndb_api_read_row_count_slaveintegerGLOBAL
Ndb_api_scan_batch_countintegerGLOBAL
Ndb_api_scan_batch_count_sessionintegerSESSION
Ndb_api_scan_batch_count_slaveintegerGLOBAL
Ndb_api_table_scan_countintegerGLOBAL
Ndb_api_table_scan_count_sessionintegerSESSION
Ndb_api_table_scan_count_slaveintegerGLOBAL
Ndb_api_trans_abort_countintegerGLOBAL
Ndb_api_trans_abort_count_sessionintegerSESSION
Ndb_api_trans_abort_count_slaveintegerGLOBAL
Ndb_api_trans_close_countintegerGLOBAL
Ndb_api_trans_close_count_sessionintegerSESSION
Ndb_api_trans_close_count_slaveintegerGLOBAL
Ndb_api_trans_commit_countintegerGLOBAL
Ndb_api_trans_commit_count_sessionintegerSESSION
Ndb_api_trans_commit_count_slaveintegerGLOBAL
Ndb_api_trans_local_read_row_countintegerGLOBAL
Ndb_api_trans_local_read_row_count_sessionintegerSESSION
Ndb_api_trans_local_read_row_count_slaveintegerGLOBAL
Ndb_api_trans_start_countintegerGLOBAL
Ndb_api_trans_start_count_sessionintegerSESSION
Ndb_api_trans_start_count_slaveintegerGLOBAL
Ndb_api_uk_op_countintegerGLOBAL
Ndb_api_uk_op_count_sessionintegerSESSION
Ndb_api_uk_op_count_slaveintegerGLOBAL
Ndb_api_wait_exec_complete_countintegerGLOBAL
Ndb_api_wait_exec_complete_count_sessionintegerSESSION
Ndb_api_wait_exec_complete_count_slaveintegerGLOBAL
Ndb_api_wait_meta_request_countintegerGLOBAL
Ndb_api_wait_meta_request_count_sessionintegerSESSION
Ndb_api_wait_meta_request_count_slaveintegerGLOBAL
Ndb_api_wait_nanos_countintegerGLOBAL
Ndb_api_wait_nanos_count_sessionintegerSESSION
Ndb_api_wait_nanos_count_slaveintegerGLOBAL
Ndb_api_wait_scan_result_countintegerGLOBAL
Ndb_api_wait_scan_result_count_sessionintegerSESSION
Ndb_api_wait_scan_result_count_slaveintegerGLOBAL
ndb_cluster_connection_poolintegerGLOBAL
Ndb_cluster_node_idintegerGLOBAL | SESSION
Ndb_config_from_hostintegerGLOBAL | SESSION
Ndb_config_from_portintegerGLOBAL | SESSION
Ndb_conflict_fn_epochintegerGLOBAL
Ndb_conflict_fn_epoch_transintegerGLOBAL
Ndb_conflict_fn_maxintegerGLOBAL
Ndb_conflict_fn_oldintegerGLOBAL
Ndb_conflict_trans_conflict_commit_countintegerGLOBAL
Ndb_conflict_trans_detect_iter_countintegerGLOBAL
Ndb_conflict_trans_reject_countintegerGLOBAL
Ndb_conflict_trans_row_conflict_countintegerGLOBAL
Ndb_conflict_trans_row_reject_countintegerGLOBAL
Ndb_execute_countintegerGLOBAL
Ndb_cluster_node_idintegerGLOBAL
Ndb_number_of_data_nodesintegerGLOBAL
Ndb_pruned_scan_countintegerGLOBAL
Ndb_pushed_queries_definedintegerGLOBAL
Ndb_pushed_queries_droppedintegerGLOBAL
Ndb_pushed_queries_executedintegerGLOBAL
Ndb_pushed_readsintegerGLOBAL
Ndb_scan_countintegerGLOBAL
Not_flushed_delayed_rowsintegerGLOBAL
Open_filesintegerGLOBAL
Open_streamsintegerGLOBAL
Open_table_definitionsintegerGLOBAL
Open_tablesintegerGLOBAL | SESSION
Opened_filesintegerGLOBAL
Opened_table_definitionsintegerGLOBAL | SESSION
Opened_tablesintegerGLOBAL | SESSION
Prepared_stmt_countintegerGLOBAL
Qcache_free_blocksintegerGLOBAL
Qcache_free_memoryintegerGLOBAL
Qcache_hitsintegerGLOBAL
Qcache_insertsintegerGLOBAL
Qcache_lowmem_prunesintegerGLOBAL
Qcache_not_cachedintegerGLOBAL
Qcache_queries_in_cacheintegerGLOBAL
Qcache_total_blocksintegerGLOBAL
QueriesintegerGLOBAL | SESSION
QuestionsintegerGLOBAL | SESSION
Rpl_statusstringGLOBAL
Select_full_joinintegerGLOBAL | SESSION
Select_full_range_joinintegerGLOBAL | SESSION
Select_rangeintegerGLOBAL | SESSION
Select_range_checkintegerGLOBAL | SESSION
Select_scanintegerGLOBAL | SESSION
Slave_heartbeat_periodnumericGLOBAL
Slave_open_temp_tablesintegerGLOBAL
Slave_received_heartbeats GLOBAL
Slave_retried_transactionsintegerGLOBAL
Slave_runningbooleanGLOBAL
Slow_launch_threadsintegerGLOBAL | SESSION
Slow_queriesintegerGLOBAL | SESSION
Sort_merge_passesintegerGLOBAL | SESSION
Sort_rangeintegerGLOBAL | SESSION
Sort_rowsintegerGLOBAL | SESSION
Sort_scanintegerGLOBAL | SESSION
Ssl_accept_renegotiatesintegerGLOBAL
Ssl_acceptsintegerGLOBAL
Ssl_callback_cache_hitsintegerGLOBAL
Ssl_cipherstringGLOBAL | SESSION
Ssl_cipher_liststringGLOBAL | SESSION
Ssl_client_connectsintegerGLOBAL
Ssl_connect_renegotiatesintegerGLOBAL
Ssl_ctx_verify_depthintegerGLOBAL
Ssl_ctx_verify_modeintegerGLOBAL
Ssl_default_timeoutintegerGLOBAL | SESSION
Ssl_finished_acceptsintegerGLOBAL
Ssl_finished_connectsintegerGLOBAL
Ssl_session_cache_hitsintegerGLOBAL
Ssl_session_cache_missesintegerGLOBAL
Ssl_session_cache_modestringGLOBAL
Ssl_session_cache_overflowsintegerGLOBAL
Ssl_session_cache_sizeintegerGLOBAL
Ssl_session_cache_timeoutsintegerGLOBAL
Ssl_sessions_reusedintegerGLOBAL | SESSION
Ssl_used_session_cache_entriesintegerGLOBAL
Ssl_verify_depthintegerGLOBAL | SESSION
Ssl_verify_modeintegerGLOBAL | SESSION
Ssl_versionstringGLOBAL | SESSION
Table_locks_immediateintegerGLOBAL
Table_locks_waitedintegerGLOBAL
Tc_log_max_pages_usedintegerGLOBAL
Tc_log_page_sizeintegerGLOBAL
Tc_log_page_waitsintegerGLOBAL
Threads_cachedintegerGLOBAL
Threads_connectedintegerGLOBAL
Threads_createdintegerGLOBAL
Threads_runningintegerGLOBAL
UptimeintegerGLOBAL
Uptime_since_flush_statusintegerGLOBAL

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”.