Tag Archives: mysql

use mysql event to maintenance Query Cache

mysql>show variables like '%event%'; 

+---------------------------------------------------+-------+
| Variable_name                                     | Value |
+---------------------------------------------------+-------+
| event_scheduler                                   | OFF   |
| performance_schema_events_waits_history_long_size | 10000 |
| performance_schema_events_waits_history_size      | 10    |
+---------------------------------------------------+-------+

mysql>SET GLOBAL event_scheduler = 1;
mysql>use database;
mysql>CREATE EVENT flush_query_cache ON SCHEDULE EVERY 1 HOUR DO FLUSH QUERY CACHE;