我已使用此查询SHOW VARIABLES LIKE ‘%query_cache%’;
检查了查询缓存的状态。同样,有任何查询或命令用于检查query_cache_type
的值。任何帮助将受到高度赞赏。
答案 0 :(得分:5)
尝试以下任何一项:
SHOW GLOBAL VARIABLES LIKE 'query_cache_type';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| query_cache_type | ON |
+------------------+-------+
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='query_cache_type';
+------------------+----------------+
| VARIABLE_NAME | VARIABLE_VALUE |
+------------------+----------------+
| QUERY_CACHE_TYPE | ON |
+------------------+----------------+
SELECT @@query_cache_type;
+--------------------+
| @@query_Cache_type |
+--------------------+
| ON |
+--------------------+
SELECT @@query_cache_type = 'ON' AS is_it_on;
+----------+
| is_it_on |
+----------+
| 1 |
+----------+
答案 1 :(得分:1)
试
SHOW VARIABLES LIKE ‘query_cache_type’;