Here is a convenient way to flush the entire contents of your Memcached instance using telnet.
$ telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
flush_all
OK
quit
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.
nc “flushall\n” localhost 11211 in one line 😛
Nice tip, thanks. I’m off to install NetCat right away 😉
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