Redis 清空缓存

来自姬鸿昌的知识库
跳到导航 跳到搜索

构建 Redis Cluster 要求集群中的所有节点都不能有数据

清空当前 DB 的数据

F:\下载目录\Redis-x64-5.0.14.1>.\redis-cli.exe -h 127.0.0.1 -p 6379
127.0.0.1:6379> auth vn4sj5kbxdaG
OK
127.0.0.1:6379> keys *
 1) "msg"
 2) "test_key"
 3) "{phoneList}:config"
 4) "codehole"
 5) "phoneList"
 6) "test_test"
 7) "\xac\xed\x00\x05t\x00\b20230218"
 8) "test_key2"
 9) "test_key1"
10) "\xac\xed\x00\x05t\x00\x05nihao"
11) "age"
12) "name"
127.0.0.1:6379> flushdb
OK
127.0.0.1:6379> keys *
(empty list or set)
127.0.0.1:6379>

清空所有 DB 的数据