总之,看到上边的显示表示设置正确,但是在实际的查询中是否能够缓存查询,还需要手动测试下,我们可以通过show status like ‘%Qcache%';语句来测试,现在我们开启了查询缓存功能,在执行查询前,我们先看看相关参数的值:
复制代码 代码如下:
mysql> show status like ‘%Qcache%';
+————————-+———–+
| Variable_name | Value |
+————————-+———–+
| Qcache_free_blocks | 1 |
| Qcache_free_memory | 134208800 |
| Qcache_hits | 0 |
| Qcache_inserts | 0 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 2 |
| Qcache_queries_in_cache | 0 |
| Qcache_total_blocks | 1 |
+————————-+———–+
8 rows in set (0.00 sec)