清理redis缓存
1、进入redis根目录或bin目录
2、登录redis
./redis-cli -h 127.0.0.1 -p 6379 -a test(密码)
3、清空当前redis数据库缓存FLUSHDB
flushdb
4、清空整个redis缓存FLUSHALL
flushall
========示例============
[root@testserver /]# cd /redis/bin/
[root@testserver bin]# ls
redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server
[root@testserver bin]# ./redis-cli -h 127.0.0.1 -p 6379 -a redis@2018@htjs
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> flushdb
OK
127.0.0.1:6379> flushall
5202:M 03 Aug 2022 16:49:47.375 * DB saved on disk
OK