首页 > 数据库技术 > 详细

MySQL 系统变量和系统状态参数详解

时间:2014-12-12 17:06:25      阅读:345      评论:0      收藏:0      [点我收藏+]


1.查询缓存相关

mysql> show variables like ‘%query_cache%‘;
+------------------------------+----------+
| Variable_name                | Value    |
+------------------------------+----------+
| have_query_cache             | YES      |
| query_cache_limit            | 1048576  |
| query_cache_min_res_unit     | 4096     |
| query_cache_size             | 67108864 |
| query_cache_type             | ON       |
| query_cache_wlock_invalidate | OFF      |
+------------------------------+----------+
6 rows in set (0.00 sec)


 have_query_cache           显示当前MySQL启动了查询缓存功能

 query_cache_size           设置查询缓存的大小,以字节为单位,可以在/etc/my.cnf中设置

 如query_cache_size= 64M。如果设置值为0表示关闭查询缓存

 query_cache_limit          超过此大小的查询将不被缓存

 

mysql> show status like ‘%Qcache%‘;
+-------------------------+----------+
| Variable_name           | Value    |
+-------------------------+----------+
| Qcache_free_blocks      | 1        |
| Qcache_free_memory      | 67099936 |
| Qcache_hits             | 0        |
| Qcache_inserts          | 0        |
| Qcache_lowmem_prunes    | 0        |
| Qcache_not_cached       | 12304    |
| Qcache_queries_in_cache | 0        |
| Qcache_total_blocks     | 1        |
+-------------------------+----------+
8 rows in set (0.00 sec)



可以使用flush query cache;命令清空缓存


本文出自 “Linux SA John” 博客,请务必保留此出处http://john88wang.blog.51cto.com/2165294/1589073

MySQL 系统变量和系统状态参数详解

原文:http://john88wang.blog.51cto.com/2165294/1589073

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!