brew install redis@3.2 #后面@接版本号可指定版本
启动
brew services start redis@3.2
To have launchd start redis@3.2 now and restart at login:
brew services start redis@3.2
Or, if you don't want/need a background service you can just run:
/usr/local/opt/redis@3.2/bin/redis-server /usr/local/etc/redis.conf
brew services stop redis
brew services restart redis
访问客户端
redis-cli
关闭客户端
redis-cli shutdown
允许远程访问
vim /usr/local/etc/redis.conf
注释bind,默认情况下 redis不允许远程访问,只允许本机访问。
参考:https://blog.csdn.net/qq_41689620/article/details/85995880