Can't enable MySQL 5.6 Query Cache

时间:2015-07-29 00:04:35

标签: mysql caching

I'm trying to enable MySQL Query Cache on Ubuntu 15.04 with MySQL 5.6.25

I've added this to end end of python ConcatenateFiles.py /tmp and /etc/mysql/my.cnf:

/etc/mysql/conf.d/mysql.cnf

The whole server has been restarted more than once.

query_cache_type = 1
query_cache_size = 4096M
query_cache_limit = 2M
query_cache_strip_comments =1

Using user@myhost:/$ mysql mysql: unknown variable 'query_cache_type=1' confirms that SHOW VARIABLES LIKE '%query_cache%'

query_cache_type = OFF

How can I solve this?

1 个答案:

答案 0 :(得分:3)

编辑文件/etc/mysql/conf.d/mysql.cnf

添加

[mysqld]
query_cache_size = 268435456
query_cache_type=1
query_cache_limit=1048576