Mac安装redis详解(附图片)

1. 下载Redis

网址: download | Redis

进入网站之后不要选择最新版下载,点击第三个(更多选择)

在这里插入图片描述
点进来之后,选择上一个版本下载就好,因为最新版可能会出一些问题

在这里插入图片描述

2. 解压文件

在这里插入图片描述
在这里插入图片描述
将刚才下载好的压缩文件移动到local文件夹内

打开终端

# 进入 /usr/local
cd /usr/local

这里要根据自己的文件名来解压,每个人的文件名不一样(不要无脑复制)

# 解压
sudo tar -zxvf redis-6.2.13.tar.gz

将解压出来的文件重命名为redis目录(也可以不重命名)

# 重命名为 redis 目录
sudo mv redis-6.2.13/ redis

3. 安装与编译

在终端下继续操作

# 进入redis目录下
cd /usr/local/redis

然后执行以下代码,进行编译测试

sudo make test

等待一会,编译大有十分钟多,当出现以下这个字段,则表示编译成功!!!

在这里插入图片描述
成功以后,再执行redis安装

sudo make install

安装成功会出现下面的提示

在这里插入图片描述

4. 运行与连接

# 运行
src/redis-server

在这里插入图片描述

说明我前面已经启动过一次了

启动java项目报错异常


cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'captchaController': Unsatisfied dependency expressed through field 'configService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysConfigServiceImpl': Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379
14:10:49.029 [restartedMain] INFO  c.a.d.p.DruidDataSource - [close,2138] - {dataSource-1} closing ...
14:10:49.033 [restartedMain] INFO  c.a.d.p.DruidDataSource - [close,2211] - {dataSource-1} closed
14:10:49.171 [restartedMain] INFO  o.a.c.c.StandardService - [log,173] - Stopping service [Tomcat]

需要启动redis

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

可口可乐Vip

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

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

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

打赏作者

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

抵扣说明:

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

余额充值