显示变量的默认值

问题描述 投票:0回答:1

我正在使用SET GLOBAL <variable> = <value>来修改mysql中的动态设置,我想知道是否有某种方法可以获得每个变量的默认值?例如,如果我使用以下内容:

SET GLOBAL max_connections = 1000;

然后使用以下内容列出变量:

SHOW GLOBAL VARIABLES LIKE 'max_connections';

我可以看到修改后的值1000,但是有可能在不检查配置文件的情况下获取此系统变量的默认值吗?

我在ubuntu 16.04上使用mysql 5.7。

mysql variables mysql-variables
1个回答
1
投票

可以从information_schema.GLOBAL_STATUS中选择

select VARIABLE_VALUE 
from information_schema.GLOBAL_STATUS 
where VARIABLE_NAME = 'max_connections';
© www.soinside.com 2019 - 2024. All rights reserved.