标签:检测 stat markdown data- uninstall 卸载 plist sfv track
使用Homebrew安装redis可以减少大量的安装和配置的工作量。
brew -v
brew install redis
To have launchd start redis at login:
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
Then to load redis now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Or, if you don’t want/need launchctl, you can just run:
redis-server /usr/local/etc/redis.conf
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
$ redis-server /usr/local/etc/redis.conf
Redis 命令用于在 redis 服务上执行操作。
要在 redis 服务上执行命令需要一个 redis 客户端。Redis 客户端在我们之前下载的的 redis 的安装包中。
$redis-cli
redis 127.0.0.1:6379>
redis 127.0.0.1:6379> PING
PONG
在以上实例中我们连接到本地的 redis 服务并执行 PING 命令,该命令用于检测 redis 服务是否启动。
$ redis-cli -h host -p port -a password
示例:
$redis-cli -h 127.0.0.1 -p 6379 -a "mypass"
redis 127.0.0.1:6379>
redis 127.0.0.1:6379> PING
PONG
============
查看所有的key
127.0.0.1:6379> keys ‘**‘
(empty list or set)
给数据库中名称为key的string赋予值value
127.0.0.1:6379> set name yihua
OK
返回数据库中名称为key的string的value
127.0.0.1:6379> get name
"yihua"
127.0.0.1:6379>
============
$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
/usr/local/etc/redis.conf
redis-cli shutdown
$ brew uninstall redis
$ rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
$ redis-cli ping
标签:检测 stat markdown data- uninstall 卸载 plist sfv track
原文地址:https://www.cnblogs.com/nicoleynh/p/9307915.html