Redis图形化管理工具Redis Desktop Manager连接Redis(CentOS)

为了更好的管理Redis的使用,常用Redis Desktop Manager来进行管理

今天测试的时候发现连接不上,就开始一点点找问题。

1、要注释掉redis.conf文件里的默认IP

################################## NETWORK #####################################

# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected 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 ::1
#
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
# following bind directive, that will force Redis to listen only into
# the IPv4 lookback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).
#
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## 首先注释掉IP
# bind 127.0.0.1

2、设置Redis密码

[root@localhost redis]# ./bin/redis-cli 
127.0.0.1:6379> config set requirepass "123456"
OK
127.0.0.1:6379> auth 123456
OK

退出后再重新通过密码登录

[root@localhost redis]# ./bin/redis-cli -h 127.0.0.1 -p 6379 -a 123456

3、Windows界面执行cmd

一、如果提示“telnet不是内部或外部命令”,请点击这里

二、如果返回的结果是一片乌黑,那么请跳过这个步骤

三、如果返回的结果如下↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

C:\Users\Administrator.000>telnet 192.168.1.100 6379
正在连接192.168.1.100...无法打开到主机的连接。 在端口 6379: 连接失败

那么继续跟着我走,回到CentOS,执行以下命令

## 如果返回 no 则表示6379端口未开启
[root@localhost ~]# firewall-cmd --query-port=6379/tcp
no
## 未开启则执行以下命令
[root@localhost ~]# firewall-cmd --add-port=6379/tcp
success
## 再次查询端口是否已开启 返回yes表示已开启
[root@localhost ~]# firewall-cmd --query-port=6379/tcp
yes

4、通过Redis Desktop Manager进行连接

这里写图片描述

END

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值