搜索redis可用版本
brew search redis
> brew search redis
Warning: Error searching on GitHub: GitHub API Error: Requires authentication
The GitHub credentials in the macOS keychain may be invalid.
Clear them with:
printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase
Create a GitHub personal access token:
https://github.com/settings/tokens/new?scopes=gist,repo,workflow&description=Homebrew
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.zshrc
==> Formulae
hiredis redis ? redis@3.2 redis@6.2 redo
iredis redis-leveldb redis@4.0 redir
==> Casks
another-redis-desktop-manager redis-pro
jpadilla-redis redisinsight
medis
直接安装最新版本
brew install redis
常用命令
启动redis,这种启动方式关闭终端窗口之后,服务仍在后台运行
brew services start redis
查看本地运行的服务列表
brew services list
连接本地的Redis,简单操作并退出连接
redis-cli -h 127.0.0.1
> redis-cli -h 127.0.0.1
127.0.0.1:6379> set a 1
OK
127.0.0.1:6379> keys a
1) "a"
127.0.0.1:6379> get a
"1"
127.0.0.1:6379> del a
(integer) 1
127.0.0.1:6379> exit
使用指定配置文件启动服务
redis-server /opt/homebrew/etc/redis.conf
测试redis server服务是否启动
redis-cli ping
本文暂时没有评论,来添加一个吧(●'◡'●)