You have two options:
Be careful here.
FlushDB deletes all keys in the current database while FlushALL deletes all keys in all databases on the current host.
tldr: flushdb
clears one database and flushall
clears all databases
Delete default or currently selected database (usually `0) with
redis-cli flushdb
Delete specific redis database with (e.g. 8
as my target database):
redis-cli -n 8 flushdb
Delete all redis databases with
redis-cli flushall
With redis-cli
:
FLUSHDB - Removes data from your connection's CURRENT database.
FLUSHALL - Removes data from ALL databases.
Redis Docs: FLUSHDB, FLUSHALL
There are right answers but I just want to add one more option (requires downtime):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With