Run cmd, cd to the redis directory
Enter "redis-cli.exe" and press Enter
Enter "auth 123456” Press Enter
If there is an error, it means that no password has been set or the set password has not taken effect
Enter “exit” and press Enter to exit redis immediately
Find the file with the suffix .conf in the redis directory. The names of the files are not uniform, so I For example, as shown below
# I have two files with the suffix .conf. Both files are opened with an editor, such as Notepad.
After opening the file, "Ctrl F" searches for "requirepass" and finds "# requirepass foobared"
Add a line below "requirepass 123456"
Then save and close,
Note that if you have two files with the suffix .conf like me, then both files must be modified like this
Complete After the above operation, first stop redis in "Service"
Then enter "redis-server.exe redis.windows.conf" in the command window and press Enter
See the following picture to indicate success ( Note that "redis.windows.conf" in the command is the file name with .conf as the suffix. Do not use "redis.windows-service.conf" as long as "redis.windows.conf" )
After completing the above operations, close the command window, and then manually start the redis service
The password will take effect at this time. You can take the first step above to verify it.
all return "OK", which means success.
The above is the detailed content of How to solve the problem of invalid Redis setting password. For more information, please follow other related articles on the PHP Chinese website!