<>1 安装redis
<>1.1 homebrew安装
brew install redis
<>1.2 配置环境变量
*
brew会将redis默认安装到/usr/local/Cellar/下
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-A6fzMO2h-1648301584013)(/Users/jiananding/Library/Application
Support/typora-user-images/image-20220326211637831.png)]
*
打开环境变量配置文件
open ~/.zshrc
*
添加如下配置,保存并退出
# Redis 6 REDIS_HOME=/usr/local/Cellar/redis/6.2.6 PATH=$PATH:$REDIS_HOME/bin
export PATH=$PATH:$REDIS_HOME
*
执行命令使上述配置生效
source ~/.zshrc
<>1.3 启动
redis-server 或 brew services start redis 或 redis-server
/usr/local/etc/redis.conf
<>1.4 杀死进程
sudo pkill redis-server