【发布时间】:2015-10-19 18:23:01
【问题描述】:
我正在尝试使用 MySQL 5.6.25
在 Ubuntu 15.04 上启用 MySQL 查询缓存我已将此添加到 /etc/mysql/my.cnf 和 /etc/mysql/conf.d/mysql.cnf 的末尾:
query_cache_type = 1
query_cache_size = 4096M
query_cache_limit = 2M
query_cache_strip_comments =1
整个服务器已多次重启。
user@myhost:/$ mysql
mysql: unknown variable 'query_cache_type=1'
使用SHOW VARIABLES LIKE '%query_cache%' 确认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 */
我该如何解决这个问题?
【问题讨论】:
-
你能做一个
find -name "my.cnf",看看你的服务器上是否还有其他my.cnf? -
有:
./etc/mysql/my.cnf ./etc/alternatives/my.cnf ./var/lib/dpkg/alternatives/my.cnf ./usr/my.cnf -
usr/my.cnf中有什么内容? -
您将参数放在
my.cnf中的什么位置?在 [mysqld] 下? -
我建议在这里发帖dba.stackexchange.com