by
tags:

MySQL (5.5) query cahce is disabled by default (size is 0).

 

mysql> SHOW VARIABLES LIKE '%query_cache%';
| have_query_cache             | YES      |
| query_cache_limit            | 1048576  |
| query_cache_min_res_unit     | 4096     |
| query_cache_size             | 0 |
| query_cache_type             | ON       |
| query_cache_wlock_invalidate | OFF      |
6 rows in set (0.06 sec)

 

To enable is you should set a size, e.g. 20MB

mysql> SET GLOBAL query_cache_size=20000000;
Query OK, 0 rows affected (0.00 sec)

 

learn more:
http://www.databasejournal.com/features/mysql/article.php/3110171/MySQLs-Query-Cache.htm