用 Redis Desktop Manager 远程连接 redis 数据库。

环境:

本机OS:window 10(本机没有安装redis)

redis 服务器:centos 7

使用 Redis Desktop Manager 工具远程连接 redis。

Redis Desktop Manager 下载地址:https://redisdesktop.com/ 针对windows下,已经不提供免费下载,可以尝试其他版本。

连接注意三点即可。

一、虚机防火墙是否关闭。

systemctl status firewalld 

如果防火墙是active,可以关闭或者添加例外。

我选择永久关闭:systemctl disable firewalld(即开机不启动)

二、6379端口是否开放。

查看端口:firewall-cmd --query-port=6379/tcp

打开端口:firewall-cmd --add-port=6379/tcp --permanent (--permanent永久生效,没有此参数重启后失效)

三、redis.conf配置文件修改

vi /etc/redis/redis.conf
 
61 # bind 127.0.0.1 #注释此行代码
80 protected-mode no #将yes改为no
 
reboot即可
说明:redis.conf文件上说用 
/usr/local/bin/redis-server /etc/redis/redis.conf
这样可以解决,但是我试了,貌似没用。

转载于:https://www.cnblogs.com/SunnyZhu/p/9833548.html

猜你喜欢

转载自blog.csdn.net/weixin_34292402/article/details/94672434