Home  >  Article  >  Database  >  How to solve the problem of invalid Redis setting password

How to solve the problem of invalid Redis setting password

王林
王林forward
2023-05-28 18:37:124754browse

1. Verify whether the password is valid

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

How to solve the problem of invalid Redis setting password

2. The solution is: directly modify the file with the suffix .conf, and then start it with the command

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

How to solve the problem of invalid Redis setting password

# 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

How to solve the problem of invalid Redis setting password

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" )

How to solve the problem of invalid Redis setting password

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.

How to solve the problem of invalid Redis setting password

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete