Redis的下载与安装(Linux&Windows)单机版

Redis的下载与安装(Linux&Windows)单机版

前言

版本说明

linux.centos=7.7.1908
linux.redis=5.0.5

windows=10
windows.redis=3.2.100

相关链接

  • Redis 官网:https://redis.io/
  • Redis 官网下载地址:https://redis.io/download
  • Redis windows 下载地址:https://github.com/MicrosoftArchive/redis/releases
  • Redis DockerHub 网址:https://hub.docker.com/_/redis
  • Redis Client 网址: https://github.com/caoxinyu/RedisClient/releases

Docker 下载安装

DockerHub 地址:https://hub.docker.com/_/redis

# 拉取
docker pull redis
# 运行
## 无密码运行
docker run -d --name redis-0 -p 6379:6379  redis
## 有密码运行
docker run -d --name redis-0 -p 6379:6379 redis --requirepass redisPassword

Linux 下载安装

环境准备

yum install -y gcc-c++

CentOS7 安装 Redis6 前提

# 查看 gcc 版本是否在5.3以上,centos7.6 默认安装 4.8.5
gcc -v
# 升级 gcc 到 5.3 及以上,如下: 
yum -y install centos-release-scl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
# 配置
echo "source /opt/rh/devtoolset-9/enable"  >> /etc/profile
# 生效
source /etc/profile

下载

Redis 官网下载地址:https://redis.io/download

mkdir -p /usr/local/redis
# 上传文件
cd /usr/local/redis
tar -zxvf redis-5.0.5.tar.gz
cd redis-5.0.5

编译与安装

cd /usr/local/redis/redis-5.0.5
# 编译
make
#安装成功之后 在redis目录下多出来一个bin目录
make PREFIX=/usr/local/redis install

启动

# 前台启动
cd /usr/local/redis/bin
./redis-server
# 后台启动
## 将 redis-5.0.5 目录下的 redis.conf 文件复制到 /usr/local/redis/bin 下
## 修改 /usr/local/redis/bin 目录下的 redis.conf 设置为后台启动, 修改 daemonize 值改成 yes 即可
## 后台启动
./redis-server redis.conf

redis.conf 设置

#  搜索 bind 127.0.0.1,注释 bind 127.0.0.1 即可远程登录访问
#  搜索 daemonize ,设置为 daemonize yes 即可后台访问
#  搜索 # requirepass foobared,去掉注释,foobared 为默认密码,可以设置其他密码
## 最终效果如下
# bind 127.0.0.1
daemonize yes
requirepass redisPassword

Redis-cli 启动验证

# 方式一,默认连接的本机6379端口
./redis-cli
# 方式二,连接指定主机 指定端口号
./redis-cli -h 192.168.8.50 -p 6379

Windows 下载安装

Redis windows 下载地址:https://github.com/MicrosoftArchive/redis/releases

zip 文件解压即安装,

msi 文件安装即可,可参考:https://blog.csdn.net/SIMBA1949/article/details/79845239

Redis 客户端

https://github.com/qishibo/AnotherRedisDesktopManager/releases

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Simba1949

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值