[root@zhyly-pre-002 ~]# /usr/local/redis/bin/redis-cli -p 6379 #登录redis
127.0.0.1:6379> auth 'Redisylypre@shuli123'
OK
127.0.0.1:6379> DEL key access* #删除对应的key
(integer) 0
127.0.0.1:6379> DEL key access_to_refresh*
(integer) 0
127.0.0.1:6379> DEL key auth*
(integer) 0
127.0.0.1:6379> DEL key auth_to_access*
(integer) 0
127.0.0.1:6379> DEL key refresh*
(integer) 0
127.0.0.1:6379> DEL key refresh_auth*
(integer) 0
127.0.0.1:6379> DEL key refresh_to_access*
(integer) 0
127.0.0.1:6379> DEL key uname_to_access*
(integer) 0
127.0.0.1:6379> DEL key client_id_access*
(integer) 0
127.0.0.1:6379> DEL key oauth_client_details*
(integer) 0
127.0.0.1:6379>
127.0.0.1:6379> get access* #检查是否删除
(nil)
批量删除key:
[root@zhyly-pre-002 ~]# /usr/local/redis/bin/redis-cli -p 6379 -a Redislecodedev@shuli123 keys "access_to_refresh:*"|xargs /usr/local/redis/bin/redis-cli -p 6379 -a Redislecodedev@shuli123 del
(integer) 21
[root@zhyly-pre-002 ~]# /usr/local/redis/bin/redis-cli -p 6379 -a Redisylypre@shuli123
127.0.0.1:6379> keys access*
1) "access:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9. #此缓存是刚才删完重新生成的,正常是没有的。