搜索:
brew search redis
安装Redis:
brew install redis
关于启动命令的提示:
To start redis now and restart at login:
brew services start redis
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/redis/bin/redis-server /opt/homebrew/etc/redis.conf
启动命令1: 默认启动
brew services start redis
启动命令2: 指定配置文件
/opt/homebrew/opt/redis/bin/redis-server /opt/homebrew/etc/redis.conf
通过 redis-server
启动:
通过命令行连接redis:
# 远程服务连接
redis-cli -h IP -p 6379
# 本机服务连接
redis-cli
关闭redis服务:
redis-cli shutdown
实测关闭不了.
查看 brew services
的相关帮助命令:
brew services -h
尝试使用如下命令关闭:
brew services stop redis
关闭成功.
最后总结常用命令:
# 启动
brew services start redis
# 链接
redis-cli
# 关闭
brew services stop redis