下载地址 http://www.redis.cn/download.html
解压 tar -zxvf redis-5.0.3.tar.gz
$ cd redis-5.0.3
$ make
$ cd src
$ ./redis-server
$ cd redis-5.0.3
$ vi redis.conf
将daemonize no改为 daemonize yes保存退出
$ cd src
$ ./redis-server ../redis.conf
$ cd src
$ ./redis-cli
127.0.0.1:6379> set a b
OK
127.0.0.1:6379> get a
"b"
$ cd redis-5.0.3
$ vi redis.conf
输入 / # requirepass foobared 查找
# requirepass foobared
requirepass yourpassword //此处注意,行前不能有空格
保存退出
重启生效
原文:https://www.cnblogs.com/yuanqt/p/10551763.html