本地idea连接Linux上Redis出现RedisConnectionException: Unable to connect to xxx.xxx.xxx.xxx:6379的问题

本人亲身经历,太痛苦了,给大家说一下所采的坑,干货,干货,干货
首先需要改redis.conf文件的配置,如下三处:
第一处:deamonize 的no 改为yes
在这里插入图片描述

第二处:找到有一行没有注释的bind 127.0.0.1,一定要注释掉,这是只可以本地虚拟机访问,你的计算机不可以访问,所以一定要注释掉

本地idea连接Linux上Redis出现RedisConnectionException: Unable to connect to xxx.xxx.xxx.xxx:6379的问题_第1张图片

第三处:protected-mode 原始值为yes表示开启远程保护,不允许本地以外访问,我们idea访问必须改为no
本地idea连接Linux上Redis出现RedisConnectionException: Unable to connect to xxx.xxx.xxx.xxx:6379的问题_第2张图片
最后在liunx的环境下一定要记得关闭防火墙,否则还是不可以访问

本地idea连接Linux上Redis出现RedisConnectionException: Unable to connect to xxx.xxx.xxx.xxx:6379的问题_第3张图片

你可能感兴趣的:(linux,redis)