“Redis 清空缓存”的版本间的差异
跳到导航
跳到搜索
Jihongchang(讨论 | 贡献) |
Jihongchang(讨论 | 贡献) |
||
第2行: | 第2行: | ||
=== 清空当前 DB 的数据 === | === 清空当前 DB 的数据 === | ||
− | + | <syntaxhighlight lang="powershell"> | |
+ | 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> | ||
+ | </syntaxhighlight> | ||
=== 清空所有 DB 的数据 === | === 清空所有 DB 的数据 === |
2023年2月20日 (一) 03:45的版本
构建 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>