木铎校园 BBS 社区2N
u(HA0M7Z-o7O4BTo set the size of the query cache, set the query_cache_size system variable. Setting it to 0 disables
the query cache. The default size is 0, so the query cache is disabled by
default.
)[#tRe z8} yV6ZN0
m Y$j?})m]n1e0When you set query_cache_size to a non-zero value,
keep in mind that the query cache needs a minimum size of about 40KB to allocate
its structures. (The exact size depends on system architecture.) If you set the
value too small, you'll get a warning, as in this example木铎校园 BBS 社区j,y8JzZ6HuE
g2FI!S.Y h-O)i0木铎校园 BBS 社区,j,@3BCs5TL\
q;P;e5M
x+z0
I8|XuZ5mQxg0(GE!U0M.ku&ohy0mysql> SET GLOBAL query_cache_size = 41984;木铎校园 BBS 社区#rV:N ^&\.U0m
u7K~U5DC7z+m0
Query OK, 0 rows affected (0.00 sec) 木铎校园 BBS 社区*|5]2w(Em.Y&o;f]]
5B
XQI/M0木铎校园 BBS 社区p'[^4`y5X Pi$vmysql> SHOW VARIABLES LIKE 'query_cache_size';
f8S,k
Id,q.c(b0木铎校园 BBS 社区_EX.c-\u0Gd
b
+------------------+-------+| Variable_name | Value |木铎校园 BBS 社区f,pP+M I2Dx)LPs
木铎校园 BBS 社区k0GL5^M|5Z~2R
+------------------+-------+| query_cache_size | 41984 |+------------------+-------+
}Q+CO/uZr.r;M;q0