问题描述
我试图使用SET VARIABLE进行设置,但是它说have_query_cache是只读的
mysql>SHOW VARIABLES LIKE 'have_query_cache';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| have_query_cache | YES |
+------------------+-------+
解决方法
对于受支持的MySQL版本(小于8.0左右),请enable the query cache in the server configuration使用例如变量query_cache_size
和query_cache_type
have_query_cache
变量仅通知您当前是否启用了缓存。