Java链接Redis时出现 “ERR Client sent AUTH, but no password is set”

Java链接Redis时出现 “ERR Client sent AUTH, but no password is set” 异常的原因及解决办法

【错误提示】

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the poolat redis.clients.util.Pool.getResource(Pool.java:53)

at redis.clients.jedis.JedisPool.getResource(JedisPool.java:226)

at cn.hncu.RedisPool.getJedis(RedisPool.java:66)

at cn.hncu.RedisJava.main(RedisJava.java:15)

Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is setat redis.clients.jedis.Protocol.processError(Protocol.java:127)

at redis.clients.jedis.Protocol.process(Protocol.java:161)at redis.clients.jedis.Protocol.read(Protocol.java:215)

at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340)

at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:239)

at redis.clients.jedis.BinaryJedis.auth(BinaryJedis.java:2139)

at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:108)

at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:868)

【问题原因】

Redis服务器没有设置密码,但客户端向其发送了AUTH(authentication,身份验证)请求。

【解决办法】

确定Redis启动时指定是哪个配置文件。

如上图是 redis.windows.conf 文件,用文本编辑工具打开文件,找到“requirepass”,去掉注释设置密码。

编辑完后保存,重新启动Redis,再运行程序,OK。

原文地址:https://www.cnblogs.com/lwcode6/p/11576721.html

时间: 2024-10-04 11:38:25

Java链接Redis时出现 “ERR Client sent AUTH, but no password is set”的相关文章

Java链接Redis时出现 “ERR Client sent AUTH, but no password is set” 异常的原因及解决办法

[错误提示] redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the poolat redis.clients.util.Pool.getResource(Pool.java:53)at redis.clients.jedis.JedisPool.getResource(JedisPool.java:226)at cn.hncu.RedisPool.getJedis(Re

Tomcat redis session manager connect redis show: ERR Client sent AUTH, but no password is set

解决问题redis问题:ERR Client sent AUTH, but no password is set - 东篱煮酒 - 博客园https://www.cnblogs.com/niepeishen/p/6371270.html authentication - ERR Client sent AUTH, but no password is set - Stack Overflowhttps://stackoverflow.com/questions/44598321/err-clie

Redis错误:jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set

原文链接:http://blog.csdn.net/rchm8519/article/details/48347797 redis.clients.util.Pool.getResource(Pool.Java:50)redis.clients.jedis.JedisPool.getResource(JedisPool.java:88)com.radiadesign.catalina.session.RedisSessionManager.acquireConnection(RedisSessi

redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set

1.项目启动报错: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool redis.clients.util.Pool.getResource(Pool.java:50) redis.clients.jedis.JedisPool.getResource(JedisPool.java:88) com.radiadesign.catalina.session.

安装Redis之后,报(error) ERR Client sent AUTH, but no password is set

Win10下,在安装完成Redis后,需要登录auth账户,验证是否安装成功. 在redis目录下redis.windows-service.conf文件找到requirepass,追加一行,输入requirepass 123456,即为登录密码,重启redis服务再登录即可.但是我并没有成功,后来发现是需要在命令行设置密码才行 解决步骤如下:1.启动redis服务 2.cmd命令行切换至Redis的文件夹中redis-cli目录或者点击redis-cli右击以管理员身份运行,打开命令窗口 ?C

解决ERR Client sent AUTH, but no password is set

在搭建cookies池时,需要将账号密码保存到redis,保存时报错:ERR Client sent AUTH, but no password is set 报错原因:Redis服务器没有设置密码,但客户端向其发送了AUTH(authentication,身份验证)请求. 解决方法:设置密码,并指定配置文件进行启动redis. 原文地址:https://www.cnblogs.com/2sheep2simple/p/10346969.html

[Redis]ResponseError: Client sent AUTH, but no password is set

由于在代码中给redis添加了密码,如下 redis_store = redis.Redis(host='localhost', port=6379, db=4, password='root') 然而redis.conf中并没有设置密码,因此报ResponseError: Client sent AUTH, but no password is set 解决方法:将password字段去除即可

CenOS 7 java链接redis数据库

完整代码 public class App { public static void main(String[] args) { System.out.println("Hello World!"); //创建连接 Config config = new Config(); config.useSingleServer().setAddress("redis://192.168.1.109:6379");//设置链接地址 RedissonClient redisso

java链接redis

创建maven项目 2.导入jar包 <dependencies> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.9.0</version> </dependency> </dependencies> 3.测试 package cn.zys.redis; im