简体   繁体   中英

Can't enable MySQL 5.6 Query Cache

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 /etc/mysql/my.cnf and /etc/mysql/conf.d/mysql.cnf :

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

The whole server has been restarted more than once.

user@myhost:/$ mysql
mysql: unknown variable 'query_cache_type=1'

Using SHOW VARIABLES LIKE '%query_cache%' confirms that query_cache_type = OFF

SET GLOBAL query_cache_type = 1;
/* SQL Error (1651): Query cache is disabled; restart the server with query_cache_type=1 to enable it */

How can I solve this?

edit file /etc/mysql/conf.d/mysql.cnf

add

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM