[mysql] Clear MySQL query cache without restarting server

Is there any way to clear mysql query cache without restarting mySQL server?

This question is related to mysql caching

The answer is


In my system (Ubuntu 12.04) I found RESET QUERY CACHE and even restarting mysql server not enough. This was due to memory disc caching.
After each query, I clean the disc cache in the terminal:

sync && echo 3 | sudo tee /proc/sys/vm/drop_caches

and then reset the query cache in mysql client:

RESET QUERY CACHE;

according the documentation, this should do it...

RESET QUERY CACHE