error when trying to connect springboot to Redis

created at 06-02-2022 views: 14

error Error in execution; nested exception is 
io.lettuce.core.RedisCommandExecutionException: NOAUTH Authentication required.

If you encounter this problem, first check whether the Redis service is started When using springboot's 2.2.6.RELEASE version to connect to Redis, an error is reported at startup

connect to redis

The configuration file is as follows

error screenshot


The reason for the error is that no password was set for Redis when Redis was installed and configured.


Now to set the password, add it to the springboot configuration file

Find the Redis installation directory and find the file

find file

Add and modify the requirepass attribute

set password

Then go to the installation directory to find redis-cli.exe

  1. Set the password: config set requirepass "123456"
  2. Connect to redis, authentication: auth 123456

set password

Finally, add the password to the configuration file:
created at:06-02-2022
edited at: 06-02-2022: