How to permanently enable query cache in MySQL? I want to know if there's a way to permanently set the size of my query cache and to make sure it's always enabled. 
Right now, I'm just using the set global query_cache_size command to set the size, but when the database is restarted it goes away.
You can set this parameter in /etc/my.cnf on Red Hat or /etc/mysql/my.cnf on Debian (other systems have the my.cnf file in various locations):

# vi /etc/my.cnf


Append config directives as follows:

query_cache_size = 268435456
query_cache_type = 1
query_cache_limit = 1048576


Change the values as appropriate to your system!