本地安装redis服务器,设置密码步骤如下
127.0.0.1:6379> config set requirepass redis123
OK
127.0.0.1:6379> config get requirepass
(error) NOAUTH Authentication required.
127.0.0.1:6379> -a redis123
(error) ERR unknown command '-a'
127.0.0.1:6379> auth redis123
OK
127.0.0.1:6379> get user
(nil)
127.0.0.1:6379>