суббота, 18 февраля 2012 г.

Enable MySQL query cache, in Gentoo

Params:

   - OS: Linux solar 3.1.6-gentoo #16 SMP Thu Jan 5 14:49:10 GMT 2012 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ AuthenticAMD GNU/Linux
   - MySQL: mysql  Ver 14.14 Distrib 5.1.61, for pc-linux-gnu (x86_64) using readline 5.1

Problem:
No problem :) I need to enable query cache in mysql for testing my site with high load.

Solution:
Edit mysql config file "/etc/mysql/my.cnf".
Add those options to the "[mysqld]" section:
query-cache-type = 1
query-cache-size = 10M

Restart mysql daemon:
/etc/init.d/mysql restart

To check cache enabled or not, run this query:
show variables like '%query_cache%';
And you will see that (and other options):
have_query_cache YES
query_cache_type ON

Комментариев нет:

Отправить комментарий