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

报错:

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
at 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 set
at 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.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set_第1张图片

用命令行进入redis目录下,启动redis-server.exe并使用配置文件redis.windows.conf启动。

报错:redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set_第2张图片
redis启动就成功了,重启程序就可以了

你可能感兴趣的:(报错:redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set)