On Centos 6.3 I'm trying to enable query caching on Mysql. I have enabled query caching
SHOW VARIABLES LIKE 'query_cache_size';
query_cache_size 52428800
SHOW VARIABLES LIKE 'query_cache_type';
query_cache_type ON
When running a few simple select queries (select * from titles), the Qcache_hits always stays 0.
(I'm using these sample mysql database: https://launchpad.net/test-db/+download)
show status like "Qcache%";
Qcache_free_blocks 1
Qcache_free_memory 52419904
Qcache_hits 0
Qcache_inserts 0
Qcache_lowmem_prunes 0
Qcache_not_cached 50
Qcache_queries_in_cache 0
Qcache_total_blocks 1
I'm out of options figuring out what's wrong here. Does anyone have an idea what can be wrong?
You probably missed the query_cache_limit option, which prevents resultsets larger than this from being cached.
You may also have a non-standard setting for query_cache_type.
I just was looking for an answer to the same problem: nothing was going into the query cache. My database name did not contain a minus (-) but did instead contain a period (.). I dumped the database -- happily it's still small as it's only in development -- and restored it into a different database with no . in the name, and the query cache is working fine now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With