1. The MySQL version used in this example is 5.6.26
2. Configure file to open cache parameters
After the configuration is complete, restart the MySQL service
Service MySQL Restart
3. See if it takes effect
Query_cache_type=on is in effect, MySQL5.6.26 is off by default
Query_cache_size is the size of the cache space
Query_cache_limit represents the upper value of a single query cache data that is not cached if it exceeds this value
4. View Cache effects
Qcache_hits: Cache Hit Ratio
Qcache_inserts: Increased counter for first query
Qcache_free_memory: Cache free space, if the value is small, indicates that the cache is not enough
Qcache_free_blocks: The number of contiguous blocks of memory in the cache, large numbers indicate fragmentation, use the command flush query cache to defragment
qcache_not_cached: Number of queries that are not suitable for caching, typically not a SELECT statement
Qcache_total_blocks: Number of blocks in cache
MySQL5.6.26 Opening the database cache