Install Redis on Windows (installed as a system service)

The article is not original, reproduced only for your own backup. Infringement contact delete
reprint address:

1. Download the Redis installation package

Here I download the 5.0 version Redis-x64-5.0.14.1.msi for windows in GitHub

Here choose the installation version in .msi format (the other .zip is installed in the first installation method in this article)

https://github.com/tporadowski/redis/releases
insert image description here
insert image description here

2. Install

insert image description hereinsert image description here①Run the .msi installation package directly, keep next until the following interface, check it and then next

insert image description here②Select the port in this step, and then next (the default is 6379, which can be modified later through the configuration file)
insert image description here
③Select the maximum cache capacity, and click next (it can be modified later through the configuration file)

insert image description hereinsert image description hereNext, you can click install to install. If you have anti-virus software installed, you will be prompted for permission, just allow all of them, don’t click wrong.

insert image description hereinsert image description here

3. Configure

① After the installation is complete, enter the redis installation directory and find the configuration file redis.windows-service.conf

Note that redis.windows-service.conf is not redis.windows.conf

The latter is the configuration file used to start the program in a non-system service mode.

insert image description here
②In the configuration file, find the words requirepass foobared, add a line after it, and enter requirepass 123456 to set the password required for accessing Redis.

Under normal test conditions, there is no need to set a password. I set 123456 here for demonstration.
insert image description here

4. Start the service

Go to Computer Services (Right-click Computer → Manage → Services and Applications → Services)

Then find the service with the Redis name on the right and check the startup status.

If not started, start it manually.

Under normal circumstances, the service should start and run normally, but because the configuration file has been modified before, the service needs to be restarted

insert image description hereIn addition, it can also be started in [Task Manager] → [Services]
insert image description here

5. Test

Test whether redis can work normally.
Use the command to enter the redis installation path
cd c:\redis

insert image description here
Enter redis-cli and press Enter (redis-cli is a client program) as shown in the figure, and the correct port number is displayed, indicating that the service has been started.

redis-cli

insert image description here
Since the password has just been configured, password authentication is required before using the service.

Enter "auth 123456" and press Enter (123456 is the previously set password).

A prompt of OK is returned to indicate that the verification is passed.

insert image description here
Then verify the set and get commands. If everything is normal, the installation and deployment are successful.

insert image description here
PS: Because the environment variables are configured. After the computer restarts, you can enter the DOS window with cmd at any position, and enter redis-cli to open the Redis client. The computer must be restarted.

Guess you like

Origin blog.csdn.net/qq_45796667/article/details/130795075