1. 程式人生 > >redis操作總結(更新中)

redis操作總結(更新中)

本地啟動redis

ps -ef | grep redis
cd /usr/local/redis/bin
./redis-server //使用預設配置啟動(比如預設不載入密碼)
./redis-server ../etc/redis.conf  //使用配置檔案啟動

redis-cli -h 127.0.0.1 -p 6379 //登入redis(無密碼)
redis-cli -h 127.0.0.1 -p 6379 -a XXX //登入redis(密碼)
auth XXX

redis命令操作
redis命令集合

問題集

ERR Client sent AUTH, but no password is set

  • 原因:redis沒有設定命令,但客戶端連線時使用了auth請求
  • 解決:設定密碼,使用配置檔案啟動

MISCONF Redis is configured to save RDB snapshots
127.0.0.1:6379> config set stop-writes-on-bgsave-error no