下载
Redis Windows下载地址
https://github.com/MicrosoftArchive/redis/releases
启动Redis服务
将下载的压缩包解压后,进入安装目录,打开DOS命令行
输入
redis-server.exe redis.windows.conf
注意,如果使用的是Powershell,可能会提示:
Suggestion [3,General]: 找不到命令 redis-server.exe,但它确实存在于当前位置。默认情况下,Windows PowerShell 不会从当前位置加载命令。如果信任此命令,请改为键入“.\redis-server.exe”。有关详细信息,请参阅 “get-help about_Command_Precedence”。
按照提示,在输入的命令前面添加.\
即可
.\redis-server.exe redis.windows.conf
控制台输出:
PS D:\Dev\Redis> .\redis-server.exe redis.windows.conf
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.2.100 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 12536
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
[12536] 07 Mar 13:30:03.324 # Server started, Redis version 3.2.100
[12536] 07 Mar 13:30:03.324 * The server is now ready to accept connections on port 6379
注册为系统服务
命令:
redis-server --service-install redis.windows.conf --loglevel verbose
控制台输出
PS D:\Dev\Redis> .\redis-server --service-install redis.windows.conf --loglevel verbose
[3864] 07 Mar 13:33:08.458 # Granting read/write access to 'NT AUTHORITY\NetworkService' on: "D:\Dev\Redis" "D:\Dev\Redis\"
[3864] 07 Mar 13:33:08.458 # Redis successfully installed as a service.
此时搜索service服务,即可发现redis
服务,手动启动即可.
使用Redis
在Redis根目录下,两种方式使用Redis命令行工具,
-
CMD打开DOS窗口,输入 .\redis-cli.exe -h 127.0.0.1 -p 6379 登录
-
双击打开redis-cli.exe文件
使用示例:
127.0.0.1:6379> set testKey Crocutax
OK
127.0.0.1:6379> get testKey
"Crocutax"
127.0.0.1:6379>
Redis桌面管理工具
(完)
参考链接:
http://blog.csdn.net/u010935342/article/details/53112392
https://www.cnblogs.com/W-Yentl/p/7831671.html