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:
-
Connect to the Redis CLI:
$ redis-cli
-
Issue the
FLUSHALL
command: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.