【Redis】【报错】redis.exceptions.ResponseError: DENIED Redis is running in protected mode

(一)报错前提

写flask 项目的时候,因为连接了私有云中的redis地址指定了IP host,启动项目的时候报错

(二)解决方法

首先要切换到root用户

root@:/etc/redis# pwd
/etc/redis
root@:/etc/redis# vim redis.conf

(1) 注释bind 127.0.0.1 ::1
(2)redis默认不是守护进程方式,yes守护进程,所以设变设置no
daemonisz no
(3)保护模式设置 no
protect-mode no
(4)重启redis
root@:/etc/redis# redis-server
(5)进入redis客户端
root@:/etc/redis# redis-cli

猜你喜欢

转载自www.cnblogs.com/totoro-cat/p/11458714.html