redis-cli 172.16.1.111
Could not connect to Redis at 127.0.0.1:6379: Connection refused
bind 127.0.0.1 172.16.1.111 # 172.16.1.111本服务器IP地址
redis-cli -h 172.16.1.111 -p 6379 -a password
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
172.16.1.111:6379> set username 'leoshi'
OK
[Redis-CentOS7]Redis打开远程连接(十) Could not connect to Redis at 127.0.0.1:6379: Connection refused
原文:https://www.cnblogs.com/leoshi/p/12318867.html