Redis Flushall 命令

Redis 教程 · 2019-03-08 18:13:19

Redis Flushall 命令用于清空整个 Redis 服务器的数据(删除所有数据库的所有 key )。

语法

redis Flushall 命令基本语法如下:

redis 127.0.0.1:6379> FLUSHALL 

可用版本

>= 1.0.0

返回值

总是返回 OK 。

实例

redis 127.0.0.1:6379> DBSIZE            # 0 号数据库的 key 数量
(integer) 9

redis 127.0.0.1:6379> SELECT 1          # 切换到 1 号数据库
OK

redis 127.0.0.1:6379> DBSIZE         # 1 号数据库的 key 数量
(integer) 6

redis 127.0.0.1:6379> flushall       # 清空所有数据库的所有 key
OK

redis 127.0.0.1:6379> DBSIZE         # 不但 1 号数据库被清空了
(integer) 0

redis 127.0.0.1:6379> SELECT 0       # 0 号数据库(以及其他所有数据库)也一样
OK

redis 127.0.0.1:6379> DBSIZE
(integer) 0

点击查看所有 Redis 教程 文章: https://codercto.com/courses/l/33.html

查看所有标签

The Art and Science of CSS

The Art and Science of CSS

Jonathan Snooks、Steve Smith、Jina Bolton、Cameron Adams、David Johnson / SitePoint / March 9, 2007 / $39.95

Want to take your CSS designs to the next level? will show you how to create dozens of CSS-based Website components. You'll discover how to: # Format calendars, menus and table of contents usin......一起来看看 《The Art and Science of CSS》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试