2

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?

8
  • 1
    can you do a find -name "my.cnf" and see if you have any other my.cnf that may be on your server? Commented Jul 29, 2015 at 0:26
  • There are: ./etc/mysql/my.cnf ./etc/alternatives/my.cnf ./var/lib/dpkg/alternatives/my.cnf ./usr/my.cnf Commented Jul 29, 2015 at 0:57
  • 1
    what is in the usr/my.cnf? Commented Jul 29, 2015 at 1:00
  • 1
    where did you place your parameters in your my.cnf? under [mysqld]? Commented Jul 29, 2015 at 1:36
  • 1
    I would suggest posting here dba.stackexchange.com Commented Jul 29, 2015 at 18:10

1 Answer 1

4

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

add

[mysqld]
query_cache_size = 268435456
query_cache_type=1
query_cache_limit=1048576
Sign up to request clarification or add additional context in comments.

1 Comment

mysql: [ERROR] unknown variable 'query_cache_type=1' I got this error while restarting mysqld

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.