1. 变更参数 : query_cache_type
如果何配置查询缓存:
query_cache_type 这个系统变量控制着查询缓存工能的开启的关闭。
query_cache_type=0时表示关闭, 1时表示打开, 2表示只要select 中明确指定SQL_CACHE才缓存。
SELECT @@global.query_cache_type;
#显性指定查询缓存
select SQL_CACHE * from t_sys_user;
query_cache_type 这个系统变量控制着查询缓存工能的开启的关闭。
query_cache_type=0时表示关闭, 1时表示打开, 2表示只要select 中明确指定SQL_CACHE才缓存。
SELECT @@global.query_cache_type;
#显性指定查询缓存
select SQL_CACHE * from t_sys_user;