Redis Flushdb 命令

Redis 服務器

Redis Flushdb 命令用于清空當前數(shù)據(jù)庫中的所有 key。

語法

redis Flushdb 命令基本語法如下:

redis 127.0.0.1:6379> FLUSHDB 

可用版本

>= 1.0.0

返回值

總是返回 OK 。

實例

redis 127.0.0.1:6379> DBSIZE    # 清空前的 key 數(shù)量
(integer) 4

redis 127.0.0.1:6379> FLUSHDB
OK

redis 127.0.0.1:6379> DBSIZE    # 清空后的 key 數(shù)量
(integer) 0

Redis 服務器