SESSION_VARIABLES

The SESSION_VARIABLES table provides information about session variables. The table data is similar to the result of the SHOW SESSION VARIABLES statement.

  1. USE INFORMATION_SCHEMA;
  2. DESC SESSION_VARIABLES;

The output is as follows:

  1. +----------------+---------------+------+------+---------+-------+
  2. | Field | Type | Null | Key | Default | Extra |
  3. +----------------+---------------+------+------+---------+-------+
  4. | VARIABLE_NAME | varchar(64) | YES | | NULL | |
  5. | VARIABLE_VALUE | varchar(1024) | YES | | NULL | |
  6. +----------------+---------------+------+------+---------+-------+
  7. 2 rows in set (0.00 sec)

Query the first 10 rows of the SESSION_VARIABLES table:

  1. SELECT * FROM SESSION_VARIABLES ORDER BY variable_name LIMIT 10;

The output is as follows:

  1. +-----------------------------------+------------------+
  2. | VARIABLE_NAME | VARIABLE_VALUE |
  3. +-----------------------------------+------------------+
  4. | allow_auto_random_explicit_insert | OFF |
  5. | auto_increment_increment | 1 |
  6. | auto_increment_offset | 1 |
  7. | autocommit | ON |
  8. | automatic_sp_privileges | 1 |
  9. | avoid_temporal_upgrade | OFF |
  10. | back_log | 80 |
  11. | basedir | /usr/local/mysql |
  12. | big_tables | OFF |
  13. | bind_address | * |
  14. +-----------------------------------+------------------+
  15. 10 rows in set (0.00 sec)

The description of columns in the SESSION_VARIABLES table is as follows:

  • VARIABLE_NAME: The name of the session-level variable in the database.
  • VARIABLE_VALUE: The value of the session-level variable in the database.