要想清空数据,按如下步骤操作:
1 停止redis server , 找到redis.conf文件中如下部分:
# It is also possible to remove all the previously configured save
# points by adding a save directive with a single empty string argument
# like in the following example:
#
save ""
然后将 save ""行添加注释(#)加上,如果去掉 会开启持久化
2 删除.rdb文件
3 重启redis server
开启持久化按照上面操作返推