NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL Query Cache

Chris Snyder csnyder at chxo.com
Mon Feb 9 13:07:29 EST 2004


I was surprised to find out this weekend that MySQL 4.x has a built-in 
query cache.
http://www.mysql.com/doc/en/Query_Cache_Configuration.html

In order to turn it on you either need to add a command line flag to 
mysqld_safe when you start the server, or add it to a my.cnf 
configuration (under [mysqld]). The cache size is specified in bytes.

The following are roughly equivalent ways to create a 20MB query cache...

Command line:
/usr/local/mysql/bin/mysqld_safe --user=mysql --skip-networking 
--query-cache-size=20971520

--or --

Using /etc/my.cnf:

[mysqld]
user=mysql
skip-networking
query-cache-size=20971520





More information about the talk mailing list