解决redis错误:ERR Client sent AUTH, but no password is set

2023年4月12日技巧分享评论58,988字数 318阅读1分3秒阅读模式

Ethan_2023-04-12_14-44-48

此错误表示您的 redis 实例中没有设置密码。

如果您从您的代码中发送身份验证信息(auth方法),就可能会收到此消息。

推荐还是设置下redis的用户密码来解决这个问题,有两种方法可以解决。

第一种,修改redis配置文件

首先打开redis的配置文件

sudo nano /etc/redis/redis.conf

取消掉注释的密码行,并设置新密码

# requirepass yourpassword

然后重启redis即可。

第二种,命令行终端修改

首先打开terminal终端并连接redis-cli

redis-cli

设置密码

CONFIG SET requirepass "yourpassword"

这样就设置成功了,你可以测试下

AUTH yourpassword 

WampServer 安装 Redis 扩展 学习笔记

WampServer 安装 Redis 扩展

最近在自己学习开发,涉及到验证码的存储问题,目前解决方案推荐的是用Redis,于是就想在本地搭建的环境中安装这个扩展。 那么具体怎么安装呢? REmote DIctionary Server(Redi...
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定