用springboot尝试连接腾讯云服务器上的redis报错密码不匹配
目录
使用环境
springboot 2.6.6
redis 6.2.6
情况一
密码设置成123456
连接成功
情况二
密码设置成0123456
连接失败
redis.conf配置如下
springboot测试
报错如下
org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 175.178.100.158/<unresolved>:6379
...
Caused by: org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 175.178.100.158/<unresolved>:6379
...
Caused by: io.lettuce.core.RedisCommandExecutionException: WRONGPASS invalid username-password pair or user is disabled.
...
但是RDM连接成功
解决方法
在application.yml配置中将redis的password加上双引号
⚠️每次重新设置密码之后 记得要在服务器 重启redis!