在线应用linux +mysqlshow variables like '%query_cache%';
+------------------------------+---------+
| Variable_name | Value |
+------------------------------+---------+
| have_query_cache | YES |
| query_cache_limit | 1048576 |
| query_cache_min_res_unit | 4096 |
| query_cache_size | 0 |--------------表明缓存区大小为0
| query_cache_type | OFF |--------------表明缓存关闭
| query_cache_wlock_invalidate | OFF |
+------------------------------+---------+
6 rows in set请问我在my.cnf如何才能配置打开 缓存??
+------------------------------+---------+
| Variable_name | Value |
+------------------------------+---------+
| have_query_cache | YES |
| query_cache_limit | 1048576 |
| query_cache_min_res_unit | 4096 |
| query_cache_size | 0 |--------------表明缓存区大小为0
| query_cache_type | OFF |--------------表明缓存关闭
| query_cache_wlock_invalidate | OFF |
+------------------------------+---------+
6 rows in set请问我在my.cnf如何才能配置打开 缓存??
解决方案 »
- 使用ADO和mysql.h访问mysql数据库有什么不同?
- 用mysqlbackupRelease1.2.1.2备份出来的数据库,如何还原?
- mysql 4.0乱码问题急求解决办法
- 中文字段插入数据的时候提示数据太长!为何啊?
- 数据库导出的问题!
- 安装有麻烦!
- 求助,如何优化count 统计left join group by having 结果集的记录数
- 这个是什么错误呢,设置外键时显示ERROR 1022: Can't write; duplicate key in table '#sql-434_2'
- MySQL的触发器是没有new这个关键字吗??
- MYSQL 咋么样获取分组后随机的2条数据 在线等大神!!!
- 宾馆软件是mssql的,想转到mysql.不知道这句存储过程该如何变化
- mysql在查询分析器怎样获得错误码?
query_cache_type = 0
query_cache_size = 0show status like '%Qcache%';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| Qcache_free_blocks | 0 |
| Qcache_free_memory | 0 |
| Qcache_hits | 0 |
| Qcache_inserts | 0 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 0 |
| Qcache_queries_in_cache | 0 |
| Qcache_total_blocks | 0 |
+-------------------------+-------+
8 rows in set
1query语句的hash运算以及hash查找资源消耗。对于每秒上千或者几千条query的高并发环境,不能他差生的cpu消耗完全忽略。 (每条sql都要到query cache里看是否存在)
2 query cache失效问题。 如果哦b表变化过于频繁,按么造成他的失效率非常高。这里表不仅表示表中数据的变更,而且表结构和索引等变化都包含。
3 他缓存的是result set。不是数据页。也就是说, 同一条记录被cache多次的可能性,从而造成内存资源的浪费。所以基本没有什么用。