admin管理员组文章数量:1613945
搭建环境:linux是centos7.4(请注意centos7以下版本的防火墙跟centos7以上的不同,使用redis客户端连接redis时会有区别,建议使用centos7以上版本)
一、下载redis客户端
官方下载地址:https://github/uglide/RedisDesktopManager/releases
二、连接windows下的redis服务器
1、确保redis服务器是启动状态
win + r 输入 services.msc
2、创建连接
3、使用命令窗口
右键点击localhost,选择Console
正常使用各种redis命令
三、连接linux下的redis服务器(如果无法连接一般是防火墙或保护模式的问题,按以下步骤操作可解决)
1、修改redis.conf配置文件
进入编辑配置文件
[root@localhost bin]# vi redis.conf
在127.0.0.1前面加上注释(redis4.0以下版本默认是注释掉的)
注释前查看进程
注释后查看进程
将受保护模式修改为no(redis4.0以下的版本没有这个模式配置,不用修改)
:wq 保存退出
2、在linux下的防火墙中开放6379端口(与centos7以下版本开放端口的方式有区别)
[root@localhost bin]# firewall-cmd --zone=public --add-port=6379/tcp --permanent
success
3、重启防火墙
[root@localhost bin]# systemctl restart firewalld
4、启动redis
[root@localhost bin]# ./redis-server redis.conf
5、连接测试
版权声明:本文标题:redis客户端连接windows和linux下的redis 无法连接 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1728657712a1168349.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论