Redis is one of the more popular NOSQL systems currently. It is a key-value storage system. Redis data is cached in computer memory, and updated data is periodically written to disk or modification operations are written to appended record files.
#The Redis project does not yet officially support Windows. However, because it is open source, the Microsoft Open Technology Group has developed and maintained a Windows interface program for Win64 and provides a Windows version of the redis branch.
How to install Redis:
1. Download Redis
You need to download it from github, address: https://github.com/MicrosoftArchive /redis/releases
The latest version is 3.2.100. Of course, there are other versions. Each version has two files, one is the MSI installation file and the other is the Zip compressed file. We click on the desired file connection and download it directly. What I have now is a Zip compressed file.
2. Install Redis
1) Save the downloaded file to any directory. Of course, the compressed file can also be decompressed to any directory, but this directory Must remember. The contents of the folder are as follows:
2), open the Redis service
Redis is divided into server and client, so we must install it first Server side, otherwise Redis will not be able to provide services for us.
First open the CMD window, it is best to run it as an administrator. Of course, first switch the command address to the directory where Redis is decompressed, and then run the command
redis-server redis.windows.conf
to see the following page , indicating that the Redis server is started successfully. It should be noted that this CMD window should not be closed. Redis started in this way is one-time, and it will not be able to provide services for us if it is closed.
3), Start the Redis client
The Redis server is started, and then we need to start the Redis client. The name of this program is :Redis-Cli.exe.
Open another Cmd window, switch the directory to the Redis compressed package decompression directory, and then run the following command directly:
redis-cli -h 192.168.127.1 -p 6379
Set the key-value pair:
set myKey abc
Remove Key-value pair:
get myKey
It needs to be explained that if we start the Redis server and client every time, we must switch the address of the Cmd command symbol, that is, change Switch the address of the current command symbol to the directory of the decompression address of the Redis compressed package to execute the corresponding file. This is a bit troublesome. We can put the address of the Redis compressed package in the "environment variable" so that we don't need to switch the address every time we use it in the future. .
The above is the detailed content of Does redis support windows?. For more information, please follow other related articles on the PHP Chinese website!