mysqldatabasexamppquery-cacheserver

How do I turn on query_cache on a Windows XAMPP Server?


In xampp/mysql/bin/my.ini

Do I add?

query_cache_size = 16777216
query_cache_type = 1
query_cache_limit = 1048576

I have tried the above and restarted mysql server but when I run this query:

SHOW VARIABLES LIKE '%query_cache%'

It says

query_cache_type is OFF

Solution

  • First try in mysql command prompt by setting it globbally and check whether its working or not, If its working it means you are updating in wrong my.ini

    mysql> SET GLOBAL query_cache_size = 41984;
    mysql> SET GLOBAL query_cache_type = 1;
    mysql> SET GLOBAL query_cache_limit = 1048576;
    
    mysql> SHOW VARIABLES LIKE 'query_cache_size';
    

    check with below command

    mysql> SHOW VARIABLES LIKE 'have_query_cache';