Unable to connect to Redis; nested exception is io.lettuce.core.RedisCommandExecutionException: NOAUTH Authentication required.解决办法
启动redis服务
你首先进入到Redis的根目录,输入
redis-server.exe redis.windows.conf
若服务启动成功,出现如下界面:
然而我这里报错:
[5024] 30 Jul 10:27:23.757 # Creating Server TCP listening socket 127.0.0.1:6379: bind: No error
采用如下解决方法:
redis-cli.exe
shutdown
exit
redis-server.exe redis.windows.conf
即可成功,若输入shutdown出现认证要求
(error) NOAUTH Authentication required.
我们需要输入密码
auth redis
如果不知道密码,可在redis的配置文件redis.conf中找到
# requirepass foobard
在下面设置自己的密码
requirepass redis
之后重启服务,进行这些步骤即可
我这里配置文件有两个,redis.windows.conf和redis.windows-service.conf,可能是版本原因,将这两个配置文件全部修改才可行。
之后Unable to connect to Redis; nested exception is io.lettuce.core.RedisCommandExecutionException: NOAUTH Authentication required问题得到解决。
若还未进行解决,可检查项目配置文件是否密码配置正确
spring.redis.host=localhost
spring.redis.port=6379
spring.redis.password=redis