How to set a password for the windows version of redis

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.

insert image description here2. Modify the configuration
Find requirePass and set the password.

requirepass yourPassword

insert image description here
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

insert image description here4. 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.
insert image description here

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.

Guess you like

Origin blog.csdn.net/qq_46112274/article/details/123269709