当前位置:网站首页>redis.exceptions.ConnectionError: Error 111 connecting to 172.16.8.128:6379. Connection refused.

redis.exceptions.ConnectionError: Error 111 connecting to 172.16.8.128:6379. Connection refused.

2022-06-13 08:23:00 庸了个白

redis 绑定了127.0.0.1,拒绝远程访问

修改 /etc/redis.conf 文件下的 bind 配置,改成 0.0.0.0,允许所有
在这里插入图片描述
修改后重启服务 service redis restart (centos7 请用命令systemctl restart redis.server)


重新连接一下,如果成功,就到这了,如果失败,你有可能遇到下面的问题:

redis.exceptions.ResponseError: NOAUTH Authentication required.

连接的信息里没有设置密码,在相关连接设置里加入 password
在这里插入图片描述

原网站

版权声明
本文为[庸了个白]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_39177678/article/details/89949487