设置redis远程访问

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

默认的配置文件 redis.conf 设置是:

绑定本机地址:bind 127.0.0.1

开启保护模式:protected-mode yes

此时连接,服务器是拒绝的
此时连接会报错:

Could not connect to Redis at 122.51.85.120:6379: Connection refused not con

因此,我们配置redis.conf,

bind 0.0.0.0

protected-mode no
此时,重启redis,即可远程访问:
在这里插入图片描述

发布了116 篇原创文章 · 获赞 107 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/qq_35385687/article/details/103097727