ERR Client sent AUTH, but no password is set‘’
时间: 2023-11-15 22:58:45 浏览: 33
这个错误通常出现在使用jedis或redisson连接redis时,客户端设置了auth认证,但是没有设置密码。解决方案有两种,一种是在redis配置文件中加入requirePass: 你的密码,另一种是将配置文件中的password注释掉。建议使用第二种方案,即将password行去掉,因为既然没有密码,就不需要写。
相关问题
ERR Client sent AUTH, but no password is set
当你启动Redis服务器时,如果没有指定配置文件,Redis会使用默认的配置。在默认情况下,Redis期望通过redis.conf文件来设置密码。然而,如果没有找到该配置文件,Redis无法设置密码,因此会报错ERR Client sent AUTH, but no password is set。解决这个问题的方法有两种。第一种方法是在启动Redis服务器之前,先通过redis-cli.exe命令行工具设置密码。你可以使用以下命令来设置密码:CONFIG SET requirepass "your_password"。然后,使用AUTH命令来进行身份验证:AUTH your_password。这种方法的缺点是每次Redis服务重启都需要重新设置密码。另一种方法是在启动Redis服务器时,通过指定配置文件的方式来设置密码。你可以使用以下命令来启动Redis服务器,并指定配置文件的路径:redis-server.exe /path/to/redis.conf。在redis.conf文件中,你可以设置requirepass参数来指定密码。这样,在启动服务器时就会自动应用该密码,避免了每次重启都需要手动设置密码的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Redis报错:ERR Client sent AUTH, but no password is set](https://blog.csdn.net/qq_37928228/article/details/110630920)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [动态添加Redis密码认证的方法](https://download.csdn.net/download/weixin_38587705/14837644)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
redis ERR Client sent AUTH, but no password is set
回答: 报错信息"ERR Client sent AUTH, but no password is set"表示Redis服务器没有设置密码,但是客户端却发送了带有密码的AUTH请求,导致报错。解决这个问题有两种方式:一种是通过命令行方式设置密码,另一种是在配置文件中去掉密码的设置。\[2\]如果选择通过命令行方式设置密码,可以使用命令"CONFIG SET requirepass yourpassword"来设置密码,将"yourpassword"替换为你想要设置的密码。如果选择在配置文件中去掉密码的设置,可以将配置文件中的"password"一行去掉,即不再设置密码。\[3\]
#### 引用[.reference_title]
- *1* *2* [Redis连接报错:ERR Client sent AUTH, but no password is set](https://blog.csdn.net/u014026084/article/details/105767907)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [redis连接错误:ERR Client sent AUTH, but no password is set解决方案2个](https://blog.csdn.net/quanaianzj/article/details/84621743)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]