1、进入redis的根目录
在redis目录输入cmd进入命令提示行,输入下面的指令启动服务器
redis-server.exe redis.windows.conf
F:\ChinaMobileDevelopment\developmentTool\Redis-x64-5.0.14.1>redis-server.exe redis.windows.conf
[16824] 20 Sep 17:01:49.673 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
[16824] 20 Sep 17:01:49.673 # Redis version=5.0.14.1, bits=64, commit=ec77f72d, modified=0, pid=16824, just started
[16824] 20 Sep 17:01:49.673 # Configuration loaded
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.14.1 (ec77f72d/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 16824
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
[16824] 20 Sep 17:01:49.673 # Server initialized
[16824] 20 Sep 17:01:49.689 * Ready to accept connections
出现以上状态,根据启动服务器后输出的信息可以看到端口号是6379
2.客户端连接服务器,输入如下命令:
F:\ChinaMobileDevelopment\developmentTool\Redis-x64-5.0.14.1>redis-cli.exe -p 6379
127.0.0.1:6379>
启动完成!
3.添加redis到环境变量中,在此不再赘述
4.将redis添加到服务中
在redis地址栏中输入cmd进入终端命令行,在命令行输入如下代码:
redis-server --service-install redis.windows.conf --loglevel notice --service-name Redis
输入完毕,打开服务验证,发现redis服务已经添加完成。