How to flush Redis cache and delete everything using the CLI

To flush all data from a Redis cache and delete everything, you can use the FLUSHALL command in the Redis CLI (command line interface).

Here’s how to use the FLUSHALL command:

  1. Connect to the Redis CLI:

     
    $ redis-cli
  2. Issue the FLUSHALL command:

     
    127.0.0.1:6379> FLUSHALL
    OK

    The FLUSHALL command will delete all keys and data from the Redis cache.

Note: The FLUSHALL command is an destructive and irreparable operation. Be very careful when using it, as it will permanently delete all data from your Redis cache. Before using this command, make sure you have a backup of your data.

Leave a Comment