Redis清除缓存(error) NOAUTH Authentication required.

 

1进入src/redis-cli    cd src/redis-cli

2执行:dbsize

3执行:flushall

4执行:exit

 

 

 

root@ubuntu:~/redis/redis-5.0.3/src# redis-cli 
127.0.0.1:6379> dbsize
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 11111(密码)
OK
127.0.0.1:6379> dbsize
(integer) 24
127.0.0.1:6379> flushall
OK
127.0.0.1:6379> exit

 

redis查询所有key值

        keys *

    config get requirepass //获取当前密码
 config set requirepass "yourpassword"//设置当前密码,服务重新启动后又会置为默认,即无密码;不建议此种方式

 

127.0.0.1:6379> auth 123456
ERR Client sent AUTH, but no password is set

设置其密码

redis 127.0.0.1:6379> CONFIG SET requirepass "123456"
OK
redis 127.0.0.1:6379> AUTH 123456
Ok

 

你可能感兴趣的:(Redis)