1.打开redis配置文件
vi /usr/local/redis/etc/redis.conf
添加requirepass 密码
将bind 127.0.0.1 ::1前的#去掉
保存退出
2.关闭redis
/usr/local/redis/bin/redis-cli shutdown
启动redis
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
3.查看
/usr/local/redis/bin/redis-cli
密码已经设置成功,需要密码才能进去,输入密码
4.设置密码后的redis 怎么关闭
/usr/local/redis/bin/redis-cli -a 密码 shutdown