Redis 密码 修改6379.conf的requirepass

[adminroot@localhost redis]$ su
Password:
[root@localhost redis]# vim 6379.conf
/requirepass
n
requirepass mypassword123
[root@localhost redis]# ps -ef|grep redis
[root@localhost redis]# kill -9 11321
[root@localhost adminroot]# redis-server /etc/redis/6379.conf &
[root@localhost adminroot]# redis-cli
127.0.0.1:6379> keys *
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth mypassword123
OK
127.0.0.1:6379> keys *
(empty list or set)
127.0.0.1:6379> exit
[root@localhost adminroot]# redis-cli -a mypassword123
127.0.0.1:6379> keys *
(empty list or set)
127.0.0.1:6379>

相关推荐