1select @@global.host_cache_size;
2@@global.host_cache_size
3123
4select @@session.host_cache_size;
5ERROR HY000: Variable 'host_cache_size' is a GLOBAL variable
6show global variables like 'host_cache_size';
7Variable_name	Value
8host_cache_size	123
9show session variables like 'host_cache_size';
10Variable_name	Value
11host_cache_size	123
12select * from information_schema.global_variables
13where variable_name='host_cache_size';
14VARIABLE_NAME	VARIABLE_VALUE
15HOST_CACHE_SIZE	123
16select * from information_schema.session_variables
17where variable_name='host_cache_size';
18VARIABLE_NAME	VARIABLE_VALUE
19HOST_CACHE_SIZE	123
20set global host_cache_size=1;
21select @@global.host_cache_size;
22@@global.host_cache_size
231
24set global host_cache_size=12;
25select @@global.host_cache_size;
26@@global.host_cache_size
2712
28set global host_cache_size=0;
29select @@global.host_cache_size;
30@@global.host_cache_size
310
32set session host_cache_size=1;
33ERROR HY000: Variable 'host_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
34set global host_cache_size=123;
35select @@global.host_cache_size;
36@@global.host_cache_size
37123
38