centos 给redis 添加访问密码

1. 更改redis.conf配置

# requirepass foobared 去掉注释,foobared改为 自己的password , 我测试的时候用的是默认的 foobared

 

2.启动redis

/usr/local/redis/src/redis-server -p 6371

3.测试

/usr/local/redis/src/redis-cli -p 6371 -a foobared

redis>set a b

(error) ERR operation not permitted      (-a 设置这个时候没起作用 )

redis>auth foobared

OK

redis>set a b

OK

redis>quit

这时,再

/usr/local/bin/redis-cli -a foobared

redis > set a b

OK

by 雪洁 2011-12-07 13:52:36 19370 views

1 Comments

About advertisement on your website 2017-03-09 20:09:30
Hello! My name is MaryMarkova, our compane need to advertise on your website. What is your prices? Thank you. Best regards, Mary.
我来说几句

相关文章