redis密码设定

来源:互联网 发布:iwatch3蜂窝网络 编辑:程序博客网 时间:2024/06/11 08:23

在redis的命令行中,通过下面的命令进行密码的设定和查看

※通过下面设定的密码服务重启之后就 无效了,设置永久 密码需要在配置文件redis.conf中设定

密码设定:config set requirepass "密码"

密码获取:config get requirepas


在配置文件redis.conf中设定永久密码

requirepass 密码


命令行通过下面的命令来进行密码的验证

auth "密码"


通过密码连接redis服务
redis-cli -h IP -a password


为了使redis能够进行远程连接,配置文件redis.conf需要进行下面的修改

①注解bind 127.0.0.1

②protected-mode yes改为protected-mode no



0 0