Skip to content

SHOW VARIABLES

Grammar Description

Shows the value of the current database system variable in the form of a list.

Grammar Structure

> SHOW VARIABLES
    [LIKE 'pattern']

Grammar definition

  • The LIKE clause displays only rows of those variables whose names match the pattern. To get a list of variables whose names match patterns, use the % wildcard in the clause.

Example

```sql mysql> SHOW VARIABLES; +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | Variable_name | Value | +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | auto_increment_increment | 1 | | auto_increment_offset | 1 | | autocommit | 1 | | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_database | utf8mb4 | | character_set_results | utf8mb4 | | character_set_server | utf8mb4 | | collation_connection | default | | collation_server | utf8mb4_bin | | completion_type | NO_CHAIN ​​| | host | 0.0.0.0 | | init_connect | | | interactive_timeout | 28800 | | license | APACHE | | lower_case_table_names | 0 | | max_allowed_packet | 16777216 | | net_write_timeout | 60 | | performance_schema | 0 | | port | 6001 | | profiling | 0 | | query_result_maxsize | 100 | | query_result_timeout | 24 | | save_query_result | 0 | | sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION | | sql_safe_updates | 0 | | sql_select_limit | 18446744073709551615 || System_time_zone | | | Testbotchvar_nodeyn 0 | | Testbothvar_dyn | 0 | | Tugglobalvar_dyn | 0 | | Tugglobalvar_nodeyn 0 | | Testsessionvar_dyn | 0 | | Testsessionvar_nodeyn 0 | | Time_zone | System | Transaction_isolation REPEANTABLE-Read | | Transaction_read_only 0 | | tx_isolation | REPEANTABLE-Read | | TX_READ_ONLY | 0 | | Version_Comment | Matrixone | | Wait_timeout | 28800 | +---------------------------------------------------------------------------------------------------------------------------------- 41 Rows in Set (0.01 sec)

MySQL> Show variables like 'auto%'; +-----------------------+------+ | Variable_name | Value | +-----------------------+------+ | Auto_increment_increment | 1 | | Auto_increment_offset | 1 | | Autocommit | 1 | +-----------------------+------+ 3 Rows in Set (0.00 sec)

mysql> show variables like 'auto_increment_increment'; +-----------------------+------+ | Variable_name | Value | +-----------------------+------+ | Auto_increment_increment | 1 | +-----------------------+------+ 1 row in set (0.00 sec) `