2

I've tried to set this by using SET VARIABLE but it said that have_query_cache is read-only

mysql>SHOW VARIABLES LIKE 'have_query_cache';
+------------------+-------+
|    Variable_name | Value |
+------------------+-------+
| have_query_cache |   YES |
+------------------+-------+
3
  • 5
    The query cache was removed in MySQL 8.0.3. have_query_cache is deprecated, always has a value of NO, and you should expect it to be removed in a future MySQL release. MySQL 8.0 Reference Manual / ... / Server System Variables Commented Oct 27, 2020 at 11:24
  • I need to allocate 32 MB of RAM for the query cache. How I can make it in MySQL 8.0? Commented Oct 27, 2020 at 11:49
  • 1
    You don't believe the User Manual which claims that the query cache is removed at all? You hope that's not true? Commented Oct 27, 2020 at 11:50

1 Answer 1

1

For supported versions of MySQL (less than 8.0 or so), you enable the query cache in the server configuration using e.g. the variables query_cache_size and query_cache_type .

The have_query_cache variable only informs you whether the cache is enabled at present.

Sign up to request clarification or add additional context in comments.

2 Comments

Okay, now I got it. As I assume I have to set query_cache_type = 1, right?
Yes, and query_cache_size to 33554432 (32*1024*1024). But they won't do anything on MySQL 8+.

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.