1. 程式人生 > >Redis Desktop Manager遠端連線Redis

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客戶端(預設是關閉的),測試成功之後就可以連線了