第一次使用Jedis操作redis是报了如下的错误:
Jedis出现DENIED Redis is running in protected mode because protected mode is enabled 问题解决
仔细看了看错误,说的是因为开启了保护模式,导致出错。
所以需要关闭redis的保护模式

解决方法

1、修改redis服务器的配置文件
vi redis.conf

2、使用 # 注释配置文件中的 bind 127.0.0.1

3、修改redis服务器的参数配置
修改redis的保护模式为no,不启用
127.0.0.1:6379> config set protected-mode “no”
OK

相关文章: