mysql_caching
This is an old revision of the document!
Enabling Query Caching
There are two options for viewing the query caching on a server:
Option 1
When logged into mysql you can use the following command to view query cache size (note: 0 means that no caching has been enabled)
SHOW VARIABLES LIKE 'query_cache_size';
Option 2
Output should look similar to:
mysql> SHOW VARIABLES LIKE 'query_cache_size'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | query_cache_size | 0 | +------------------+-------+
Setting caching size
The command below is an example of setting the global caching of mysql to 16MB.
SET GLOBAL query_cache_size = 16777216;
An example of editing the /etc/my.cnf file is:
query_cache_size = 268435456 query_cache_type=1 query_cache_limit=1048576
mysql_caching.1428479046.txt.gz · Last modified: 2024/05/23 07:26 (external edit)