1. Find the configuration file redis.windows.conf
as shown in the figure below, which is the directory of the redis free installation version. Open the redis.windows.conf file.
2. Modify the configuration
Find requirePass and set the password.
requirepass yourPassword
3. Save the configuration and start the redis service through the command
D:\Program Files\Redis-x64-3.2.100> redis-server.exe redis.windows.conf
4. The local reids client tool connects to redis. When no password is entered, we find that we cannot connect to redis, indicating that the redis password is set successfully.
5. If the startup reports an error
#Warning: no config file specified, using the default config. In order to specify a config file use redis-server.exe /path/to/redis.conf
It means that the default conf file is not used
Solution: Execute redis-server.exe redis.windows.conf on the command line, and that's it.