MySQL 9.0 Reference Manual Including MySQL NDB Cluster 9.0

29.12.14.4 Performance Schema variables_metadata Table

The variables_metadata table shows, for each server system variable, its name, scope, type, range of values (where applicable), and description.

The variables_metadata table contains these columns:

The variables_metadata table has no indexes.

This table is read-only. The only DML statements allowed are SELECT and TABLE; DDL statements including TRUNCATE TABLE are not permitted.

The three queries using the variables_metadata table shown in the following example provide information about the binlog_row_image, innodb_doublewrite_batch_size, and secure_file_priv system variables:

mysql> SELECT * FROM variables_metadata WHERE VARIABLE_NAME='binlog_row_image'\G
*************************** 1. row ***************************
 VARIABLE_NAME: binlog_row_image
VARIABLE_SCOPE: SESSION
     DATA_TYPE: Enumeration
     MIN_VALUE: 
     MAX_VALUE: 
 DOCUMENTATION: Controls whether rows should be logged in 'FULL', 'NOBLOB' or
'MINIMAL' formats. 'FULL', means that all columns in the before and after image
are logged. 'NOBLOB', means that mysqld avoids logging blob columns whenever
possible (e.g. blob column was not changed or is not part of primary key).
'MINIMAL', means that a PK equivalent (PK columns or full row if there is no PK
in the table) is logged in the before image, and only changed columns are logged
in the after image. (Default: FULL).      
1 row in set (0.01 sec)

mysql> SELECT * FROM variables_metadata WHERE VARIABLE_NAME='innodb_doublewrite_batch_size'\G
*************************** 1. row ***************************
 VARIABLE_NAME: innodb_doublewrite_batch_size
VARIABLE_SCOPE: GLOBAL
     DATA_TYPE: Integer
     MIN_VALUE: 0
     MAX_VALUE: 256
 DOCUMENTATION: Number of double write pages to write in a batch
1 row in set (0.00 sec)

mysql> SELECT * FROM variables_metadata WHERE VARIABLE_NAME='secure_file_priv'\G
*************************** 1. row ***************************
 VARIABLE_NAME: secure_file_priv
VARIABLE_SCOPE: GLOBAL
     DATA_TYPE: String
     MIN_VALUE: 
     MAX_VALUE: 
 DOCUMENTATION: Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files within specified directory
1 row in set (0.01 sec)

This table does not show the current values of system variables; this information is provided by the Performance Schema global_variables and session_variables tables.

The variables_metadata table was added in MySQL 9.0.