In Redis you can flush cache/database and delete all keys from all databases or from the particular database only using FLUSHALL
and FLUSHDB
commands.
To delete all keys from all Redis databases, use the FLUSHALL
command.
To delete all keys of the selected Redis database only, use the FLUSHDB
commnad.
Cool Tip: List all keys from the all databases in Redis! Read more →
Delete All Keys In Redis
Delete all keys from all Redis databases:
$ redis-cli FLUSHALL
Delete all keys of the currently selected Redis database:
$ redis-cli FLUSHDB
Delete all keys of the specified Redis database:
$ redis-cli -n <database_number> FLUSHDB
Awesome!
Some info for a Redis cluster:
For a cluster there is only one database and the FLUSHDB/FLUSHALL command has to be executed on *every* master.