How To Flush Contents Of a Memcached Server Using Command Line

To flush the contents of a Memcached server using the command line, you can use the flush_all command.

Here’s how to flush the contents of a Memcached server:

  1. Open a terminal window or log in to a virtual console.
  2. Connect to the Memcached server using the telnet command:
    telnet <hostname> <port>

    Replace <hostname> with the hostname or IP address of the Memcached server, and replace <port> with the port number that the Memcached server is listening on. The default port number for Memcached is 11211.

  3. Type the following command to flush the contents of the Memcached server:
    flush_all

    The contents of the Memcached server will be immediately flushed, and all cached data will be deleted.

  4. Type the following command to close the connection to the Memcached server:
    quit

Note: In order to use the flush_all command, you must have administrative access to the Memcached server. The exact syntax and options for the flush_all command may vary depending on the version of Memcached being used, so it’s a good idea to consult the Memcached documentation for more information.

Leave a Comment