English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Flushall Command

Redis Server

The Redis Flushall command is used to clear the entire Redis server's data (deleting all keys in all databases).

Syntax

Basic Syntax of Redis Flushall Command

redis 127.0.0.1:6379> FLUSHALL

Available Version

>= 1.0.0

Return Value

Always returns OK.

Online Examples

redis 127.0.0.1:6379> DBSIZE # The key count of 0th database
(integer) 9
redis 127.0.0.1:6379> SELECT 1          # Switch to 1 th database
OK
redis 127.0.0.1:6379> DBSIZE # 1 th database's key count
(integer) 6
redis 127.0.0.1:6379> flushall # Clear all databases' keys
OK
redis 127.0.0.1:6379> DBSIZE # Not only 1 th database was cleared
(integer) 0
redis 127.0.0.1:6379> SELECT 0 # 0th database (and all other databases) as well
OK
redis 127.0.0.1:6379> DBSIZE
(integer) 0

 

Redis Server