1、docker ps |grep redis
2、docker exec -it qinghai-sc-xining-redis-single/eadd4cc4eefe bin\sh --进入redis容器
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# docker ps|grep redis
eadd4cc4eefe redis "docker-entrypoint.s…" 4 months ago Up 4 months 0.0.0.0:6379->6379/tcp qinghai-sc-xining-redis-single
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# docker exec -it qinghai-sc-xining-redis-single redis-cli
127.0.0.1:6379>
127.0.0.1:6379>
127.0.0.1:6379>
输入命令:docker exec -it 13e08d406533 redis-cli -a 123456
或者 docker exec -it 13e08d406533 redis-cli -h 127.0.0.1 -p 6379 -a 123456
注:
-h 127.0.0.1 :默认不加为-h 127.0.0.1
-p 6379 :默认不加为 -p 6379
13e08d406533 :容器id
————————————————
参考文档
https://baijiahao.baidu.com/s?id=1701162257808597999&wfr=spider&for=pc
https://blog.csdn.net/m0_67392661/article/details/126327509
https://blog.csdn.net/qq_45401910/article/details/122321256
https://blog.csdn.net/l688899886/article/details/125487592
https://www.runoob.com/redis/redis-geo.html