How do I delete everything in Redis?
With redis-cli:
- FLUSHDB – Deletes all keys from the connection's current database.
- FLUSHALL – Deletes all keys from all databases.
For example, in your shell:
redis-cli flushall
Heads up that FLUSHALL
may be overkill. FLUSHDB
is the one to flush a database only. FLUSHALL
will wipe out the entire server. As in every database on the server. Since the question was about flushing a database I think this is an important enough distinction to merit a separate answer.