打开redis的配置文件
################################## SECURITY ###################################
# Require clients to issue AUTH <PASSWORD> before processing any other
# commands. This might be useful in environments in which you do not trust
# others with access to the host running redis-server.
#
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
#
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
#
requirepass 875213 ------------>设置密码
[root@yuanmomo myredis]# redis-cli
127.0.0.1:6379> set key sss
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 875213 -------->输入密码才能使用redis