Check the server variable in Session or Global in MySQL

Check all the Server Variable in MySQL

SHOW VARIABLES;

Check only Session variable in MySQL

SHOW SESSION VARIABLES;

Check Global Variable in MySQL

SHOW GLOBAL VARIABLES;

Example of using with LIke or Where in Show command

SHOW [GLOBAL | SESSION] VARIABLES LIKE '%size%';
SHOW [GLOBAL | SESSION] VARIABLES WHERE VALUE > 0;


mysql> SHOW GLOBAL  VARIABLES LIKE 'max_join_size';
+---------------+----------------------+
| Variable_name | Value                |
+---------------+----------------------+
| max_join_size | 18446744073709551615 |
+---------------+----------------------+
1 row in set (0.03 sec)


mysql> SHOW SESSION VARIABLES LIKE '%log_cache_size%';
+-----------------------+----------------------+
| Variable_name         | Value                |
+-----------------------+----------------------+
| binlog_cache_size     | 32768                |
| max_binlog_cache_size | 18446744073709547520 |
+-----------------------+----------------------+
2 rows in set (0.01 sec)


mysql> SHOW GLOBAL VARIABLES WHERE VALUE > 1000000000000;
+----------------------------+----------------------+
| Variable_name              | Value                |
+----------------------------+----------------------+
| max_binlog_cache_size      | 18446744073709547520 |
| max_binlog_stmt_cache_size | 18446744073709547520 |
| max_join_size              | 18446744073709551615 |
| myisam_mmap_size           | 18446744073709551615 |
| parser_max_mem_size        | 18446744073709551615 |
| sql_select_limit           | 18446744073709551615 |
+----------------------------+----------------------+
6 rows in set, 260 warnings (0.00 sec)