NOAUTH: NOAUTH Authentication required(需要认证)
Redis含义
Redis 要求认证,但客户端在认证之前就尝试执行命令。必须先用 AUTH 登录。
原因
服务器设置了 requirepass/ACL 密码、客户端未发送 AUTH 命令、连接字符串中缺少密码,或连接重建后未再次执行 AUTH。
解决方法
执行命令前先进行认证:AUTH password(使用 ACL 时为 AUTH app_user password)。将密码添加到客户端/连接字符串中。如果使用连接池,确保每个新连接都执行 AUTH。安全地存储密码(环境变量/密钥管理器)。
同一数据库的其他条目
- WRONGTYPEWRONGTYPE Operation against a key holding the wrong kind of value(对持有错误类型值的键执行了操作)
- OOMOOM command not allowed when used memory > 'maxmemory'(已用内存 > 'maxmemory' 时不允许执行命令)
- WRONGPASSWRONGPASS invalid username-password pair or user is disabled(用户名-密码组合无效或用户已禁用)
- READONLYREADONLY You can't write against a read only replica(不能对只读副本执行写入)
- MASTERDOWNMASTERDOWN Link with MASTER is down and replica-serve-stale-data is set to 'no'(与 MASTER 的连接已断开,且 replica-serve-stale-data 设为 'no')
- CLUSTERDOWNCLUSTERDOWN The cluster is down / Hash slot not served(集群已宕机 / 哈希槽未被服务)