记录下MacOS M1版在本地安装 Redis 的步骤
参考:
https://blog.csdn.net/qq_41855420/article/details/103691030
https://blog.csdn.net/Mint6/article/details/124156340
没装 Homebrew 的看看之前发的这篇里的准备工作部分:MacOS M1 使用 Homebrew 安装 Mysql
终端运行命令安装:
brew install redis
注意安装完成后的提示,有安装目录以及重启命令。
管理命令推荐用 brew
,如下:
启动:brew services start redis
重启:brew services restart redis
停止:brew services stop redis
下面是另外的一些启动关闭方式:
停止:redis-cli shutdown
启动:
/opt/homebrew/opt/redis/bin/redis-server /opt/homebrew/etc/redis.conf
环境变量可配可不配。配的话步骤如下:
vim ~/.zshrc
打开文件增加一行export PATH=$PATH:/opt/homebrew/opt/redis/bin
source ~/.zshrc
之后用 redis-server /opt/homebrew/etc/redis.conf
即可启动