How to flush the contents of a Memcached instance

Here is a convenient way to flush the entire contents of your Memcached instance using telnet.

$ telnet localhost 11211
Connected to localhost.
Escape character is '^]'.
Connection to localhost closed by foreign host.

Once you are connected to the appropriate memcached host and port (using telnet), use the flush_all command (which should return an OK response) followed the quit command to flush the current cache contents.

3 thoughts on “How to flush the contents of a Memcached instance”

  1. The netcat syntax in comment #1 resulted in an error for me, but I was able to get it to work on my system using this syntax:

    echo ‘flush_all’ | nc localhost 11211

Leave a Reply