安裝
使用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
默認(rèn)安裝路徑:/usr/local/opt/redis/bin/redis-server
守護(hù)進(jìn)程啟動
brew services start redis
如果看到Successfully started redis
說明啟動成功
客戶端工具
進(jìn)入 /usr/local/opt/redis/bin 目錄坚俗,執(zhí)行
./redis-cli
啟動客戶端鏈接
插入數(shù)據(jù)檢查是否成功
127.0.0.1:6379> set name "hello"
OK
127.0.0.1:6379> get name
"hello"