Redis Desktop Manager远程连接Redis

主要是有两步,都是需要修改redis.conf配置文件

第一步:修改redis.conf中的bind地址,默认是#bind 127.0.0.1,就是只能本地登录,我们可以将其改成bind 0.0.0.0(注意去掉前面的#号)

# By default Redis listens for connections from all the network interfaces
# available on the server. It is possible to listen to just one or multiple
# interfaces using the "bind" configuration directive, followed by one or
# more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
#bind 127.0.0.1
bind 0.0.0.0

第二步:添加密码,如果不添加密码的话,redis是默认保护模式,也就是只能在本地虚拟机上登录,所以我们需要添加密码

修改redis.conf中的requirepass配置项,将# requirepass foobared修改成requirepass root(改成你自己设置的密码,同时也需要去掉之前的注释#号)

# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
#
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
#
# requirepass foobared
requirepass root

此时就可以使用Redis Desktop Manager进行连接了,我是在win7上面连接ubuntu上的redis,可以先测试一下能不能连接上远程虚拟机上的6379端口,打开cmd窗口,使用

telnet 192.168.1.244 6379(需要修改成自己的ip)命令进行测试,如果显示“”telnet不是内部或外部命令“”,需要打开telnet客户端(默认是关闭的),测试成功之后就可以连接了



©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页