[TOC] ### 查看是否设置密码 ``` 127.0.0.1:6379> CONFIG get requirepass 1) "requirepass" 2) "" //密码为空 ``` ### 设置密码 ``` 127.0.0.1:6379> CONFIG set requirepass "runoob" OK 127.0.0.1:6379> CONFIG get requirepass 1) "requirepass" 2) "runoob" ``` ### 连接 ``` 127.0.0.1:6379> AUTH "runoob" OK ```