1. Find the directory where Redis is located, and enter cmd in the file path box:
2. Enter the directory where Redis is located under the console, and enter the following command:
redis-server --service-install redis.windows-service.conf --loglevel verbose
3. Find the redis.windows-service.conf file, double-click to open the password for setting the redis service:
(If you do not want to set a password, this step can be omitted)
4. Press CTRL+F, search for "pass" (with a space behind), and add a password:
(If you do not want to set a password, this step can be omitted)
requirepass root
5. Search for "Service" in the start menu, and you can see that the Redis service has been added after opening:
6. Configure the redis data source in the java project:
Note: If step 4 and step 5 are omitted and no password is set, the password cannot be configured in the configuration source, otherwise an error will be reported:
ERR Client sent AUTH, but no password is set