1

我已经使用这个查询检查了查询缓存的状态SHOW VARIABLES LIKE ‘%query_cache%’;。同样,是否有任何查询或命令来检查query_cache_type. 任何帮助将不胜感激。

4

2 回答 2

8

尝试以下任何一种:

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 |
+----------+
于 2012-07-19T11:06:20.793 回答
1

尝试

SHOW VARIABLES LIKE 'query_cache_type';
于 2012-07-19T10:27:37.353 回答