Clear MySQL query cache without restarting server

Mahoor13 picture Mahoor13 · Mar 8, 2011 · Viewed 227.3k times · Source

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

Answer

John Parker picture John Parker · Mar 8, 2011

I believe you can use...

RESET QUERY CACHE;

...if the user you're running as has reload rights. Alternatively, you can defragment the query cache via...

FLUSH QUERY CACHE;

See the Query Cache Status and Maintenance section of the MySQL manual for more information.