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 Ruby Programming Language

The Ruby Programming Language

David Flanagan、Yukihiro Matsumoto / O'Reilly Media, Inc. / 2008 / USD 39.99

Ruby has gained some attention through the popular Ruby on Rails web development framework, but the language alone is worthy of more consideration -- a lot more. This book offers a definition explanat......一起来看看 《The Ruby Programming Language》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码