Redis for mac 安装及使用

安装

使用brew 来安装,如果没有这个命令,请先安装homebrew

brew install redis

安装成功提示:

To have launchd 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:
redis-server /usr/local/etc/redis.conf

默认安装路径:/usr/local/opt/redis/bin/redis-server

守护进程启动

brew services start redis

如果看到Successfully started redis说明启动成功

客户端工具

进入 /usr/local/opt/redis/bin 目录,执行

./redis-cli 

启动客户端链接

插入数据检查是否成功

127.0.0.1:6379> set name "hello"
OK
127.0.0.1:6379> get name
"hello"

你可能感兴趣的:(Redis for mac 安装及使用)