[Redis-CentOS7]Redis打开远程连接(十) Could not connect to Redis at 127.0.0.1:6379: Connection refused

通过网络无法访问Redis

redis-cli 172.16.1.111
Could not connect to Redis at 127.0.0.1:6379: Connection refused

修改配置文件

vi /etc/redis.conf
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
posted @ 2020-02-16 21:33  LeoShi2020  阅读(1135)  评论(0编辑  收藏  举报