liunx centos9中安装Redis数据库,并在win10中连接redis图文详解

首先我们去Redis的官网点击download下载tar的压缩包
https://redis.io/download/#redis-downloads
liunx centos9中安装Redis数据库
用xftp将安装包上传到你的liunx服务器本地地址在这里插入图片描述
解压
tar -xvf /root/redis-7.0.8.tar.gz
cd进入你刚才解压的文件夹中
cd /root/redis-7.0.8
执行make进行编译
编译·完成后cd进入刚才安装好的src文件夹中
cd /root/redis-7.0.8/src
然后./redis-server启动redis服务
在这里插入图片描述
虽然redis目前是成功启动,但是如果是上图那样的话,我们是无法继续进行操作,所以需要修改一下配置,用xftp找到redis.conf这个文件
在这里插入图片描述
ctrl+F搜索daemonize no将no改成yes
然后再保存文件,重启服务后使用

./redis-server …/redis.conf
命令启动
在这里插入图片描述
使用./redis-cli与 redis 服务交互出现本地端口号即代表连接成功
在这里插入图片描述
然后我们随便定义一个键能够看到返回值就代表安装成功
在这里插入图片描述
我们需要用到图形化管理,这里我建议用RedisStudio可以自行搜索一下,但是目前为止redis数据库我们是无法在win10中进行连接
在这里插入图片描述
找到redis.conf
将这里的127.0.0.1前面加个#注释掉

同时关闭保护模式将之前的yes改成protected-mode no
然后保存退出重新启动一下redis

#bind 0.0.0.0

# By default, outgoing connections (from replica to master, from Sentinel to
# instances, cluster bus, etc.) are not bound to a specific local address. In
# most cases, this means the operating system will handle that based on routing
# and the interface through which the connection goes out.
#
# Using bind-source-addr it is possible to configure a specific address to bind
# to, which may also affect how the connection gets routed.
#
# Example:
#
# bind-source-addr 10.0.0.1

# Protected mode is a layer of security protection, in order to avoid that
# Redis instances left open on the internet are accessed and exploited.
#
# When protected mode is on and the default user has no password, the server
# only accepts local connections from the IPv4 address (127.0.0.1), IPv6 address
# (::1) or Unix domain sockets.
#
# By default protected mode is enabled. You should disable it only if
# you are sure you want clients from other hosts to connect to Redis
# even if no authentication is configured.
protected-mode no

修改密码
在这里插入图片描述

用ps检查redis进程
ps -ef|grep redis
出现*表示都可以连接
在这里插入图片描述
然后我们再关闭防火墙
systemctl stop firewalld
我们打开RedisStudio输入你的虚拟机ip地址端口号和密码就会出现绿色连接成功

在这里插入图片描述
点击Data就会出现一个我们刚开始输入的test的value值
在这里插入图片描述

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

轻烟飘荡

我想吃甜筒

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值