DevOps
Linux Systems Engineer
- Joined
- Oct 18, 2019
- Messages
- 192
- Reaction score
- 17
- Points
- 18
- Location
- Novosibirsk, Russia
- Website
- addons.vevioz.com
Offline
I want a blank database and get rid of all keys. How can I delete everything in Redis cache? How do I flush my Redis cache using the Linux/Unix command line option?
You can flush cache/database and delete all keys using any one of the following command:
The syntax is:
Examples
Type the following command to delete all the keys of the DB # 4:
You can flush cache/database and delete all keys using any one of the following command:
- FLUSHDB command – Delete all the keys of the currently selected DB.
- FLUSHALL command – Delete all the keys of all the existing databases, not just the currently selected one.
Syntax to flush Redis cacheWarning: Once removed data/keys/values can not be recovered. Be careful when typing the following commands.
The syntax is:
Code:
redis-cli FLUSHDB
redis-cli -n DB_NUMBER FLUSHDB
redis-cli -n DB_NUMBER FLUSHDB ASYNC
redis-cli FLUSHALL
redis-cli FLUSHALL ASYNC
redis-cli -n 4 FLUSHDB
Examples
Type the following command to delete all the keys of the DB # 4:
Code:
redis-cli -n 4 FLUSHDB
Last edited: