使用mac的包管理工具brew一行命令搞定安装。若未安装brew,命令行先输入以下命令安装brew。
/bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
查看安装包
brew search redis
选择6.2版本,进行安装
brew install redis@6.2
启动
brew services start redis
关闭
brew services stop redis
重启
brew services restart redis
打开图形化界面
redis-cli
开机启动redis命令
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
使用配置文件启动redis-server
redis-server /usr/local/etc/redis.conf
停止redis服务
redis-cli shutdown
redis配置文件位置
cat /usr/local/etc/redis.conf
卸载redis
brew uninstall redis rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist