Article directory
Reference information for installation: https://www.runoob.com/redis/redis-install.html
1. Installation and download of redis
1. Download
Download address: https://github.com/tporadowski/redis/releases.
2. Decompress
Unzip it to the c drive and rename the folder to redis. The path is C:\redis
The unzipped content is:
3. Start redis
As an administrator, open a cmd window, change the directory to C:\redis and run:
redis-server.exe redis.windows.conf
If the configuration file is not specified, no password is required by default
. The following redis.windows.conf can be omitted. If omitted, the default one will be enabled. After input, the following interface will be displayed:
4. Test whether the installation is successful
At this time, open another cmd window as an administrator for testing. Do not close the original one, otherwise you will not be able to access the server.
Switch to the redis directory and run:
redis-cli.exe -h 127.0.0.1 -p 6379
set name "wl"
get name
# 精简模式:
redis-cli.exe
# 指定模式:
redis-cli.exe -h 127.0.0.1 -p 6379 -a requirepass
# -h 服务器地址
# -p 指定端口号
# -a 连接数据库的密码[可以在redis.windows.conf中配置],默认无密码
2. Add redis to windows service
Installation command:
redis-server.exe --service-install redis.windows.conf --loglevel verbose
Use the command and the installation is successful, as shown in the figure:
3. Commonly used redis service commands
# 卸载服务:
redis-server --service-uninstall
# 开启服务:
redis-server --service-start
# 停止服务:
redis-server --service-stop
# 重命名服务:
redis-server --service-name name