enable mysql Query cache

How to enable mysql Query cache on linux server?
Ans: You need to login to mysql by using root accesss.
==========================
root@server[~]#mysql -u root –pPASSWORD
mysql> SET GLOBAL query_cache_size = 16777216;              (If you want to set query_cache_size=16 MB)
==========================
Then open the my.cnf file and add the following directives.
# vi /etc/my.cnf
query_cache_size = 268435456
query_cache_type=1
query_cache_limit=1048576
Then restart the mysql service
Done

Leave a Comment