redis-cli -h 192.168.1.21 -p 6379 -a 123456

h:ip地址
p:端口号
a:密码

或者使用redis-cli进入之后,使用auth [password]

更多推荐

redis使用redis-cli登录