JAVA连接REDIS数据库

1.导入相关jar包  jedis.jar和commons.jar包

2.通过Jedis 类连接Redis

@SuppressWarnings("resource")

Jedis jedis = new Jedis("192.168.56.128");

2.保护模式

DENIED Redis is running in protected mode because protected mode is enabled…

redis处于保护模式,只能本地链接,我们需要修改配置文件redis.conf,将protected-mode yes改成no

posted on 2019-07-13 20:06  袁音元音i  阅读(411)  评论(0编辑  收藏  举报