Enable mysql Query Cache in linux server?

Enable mysql Query Cache in linux server?

If you database(MySQL) is very heavy and you want to optimized and speedy response from your MySQL server then you want to make below changes your MySQL server. The MySQL Query Cache enables query results to be cached so if the same query is run multiple times the second and subsequent times the query are run are a most instant. Lest start Enable mysql Query Cache in linux server.

First you need to login MySql via using root accesss.

For Example :-

root@youknowlinux[~]#mysql -u root –pPASSWORD

mysql> SET GLOBAL query_cache_size = 31457280;   (If you want to set query_cache_size=32 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

After that restart the mysql service

root@youknowlinux[~]# service mysql restart
Or
root@youknowlinux[~]#/etc/init.d/mysql restart
 
Done

Bookmark the permalink.

Comments are closed.