Redis cleans the cache under docker

1. View the image id of the redis image

 docker ps

2. Enter redis through the mirror id

docker exec -i -t 镜像id或者镜像名称 /bin/bash

3. Log in to the redis service on the specified port. If there is a password set by Redis, add -a

(where -h: parameter indicates redis host IP; -p: parameter indicates redis service port number; -a: parameter indicates redis password;):

redis-cli -h IP地址 -p 端口号 -a 密码

4. After logging in to redis, check all key values

keys *

5. Delete the cache of the specified key

del key

6. Clear the current database cache

flushdb

7. Clear all caches of the entire redis

flushall

8. Exit the redis service

exit

9. Exit the redis container

exit

Guess you like

Origin blog.csdn.net/ABCAA1024/article/details/125872482