Redis Flushdb Command
The Redis Flushdb command is used to clear all keys in the current database.
Syntax
The basic syntax of the redis Flushdb command is as follows:
redis 127.0.0.1:6379> FLUSHDB
Available Versions
>= 1.0.0
Return Value
Always returns OK.
Examples
redis 127.0.0.1:6379> DBSIZE # 清空前的 key 数量 (integer) 4 redis 127.0.0.1:6379> FLUSHDB OK redis 127.0.0.1:6379> DBSIZE # 清空后的 key 数量 (integer) 0
Other Extensions