win7 安装redis服务

Redis官方是不支持windows的,只是 Microsoft Open Tech group 在 GitHub上开发了一个Win64的版本,项目地址是: https://github.com/MSOpenTech/redis

其实安装很简单,使用Microsoft Open Tech group开发的windows版本,直接安装就行,然后创建一个redis服务,so easy~

1、下载 redis
打开https://github.com/MSOpenTech/redis 地址如图:

点击releases 选择相应的版本(以Redis-x64-3.2.100.zip为例):
https://github.com/MSOpenTech/redis/releases/download/win-3.2.100/Redis-x64-3.2.100.zip
https://github.com/MSOpenTech/redis/releases/download/win-3.2.100/Redis-x64-3.2.100.msi

redis解压文件
将下载的压缩文件解压到安装目录下, 例如:
我安装在
D:\service\redis
目录下

2、使用批处理文件安装redis服务

2.1、在redis目录下新建安装redis服务批处理文件 install.bat(双击即可安装)。

redis-server.exe --service-install redis.windows.conf --loglevel verbose

2.2、在redis目录下新建开启、关闭服务批处理文件 redis-toggle.bat。

@echo off
for /f "skip=3 tokens=4" %%i in ('sc query Redis') do set "zt=%%i" &goto :next
:next
if /i "%zt%"=="RUNNING" (
redis-server.exe --service-stop
echo redis stopped。
) else (
redis-server.exe --service-start
echo redis running now。
)

pause>nul

2.3、在redis目录下新建卸载redis服务批处理文件 uninstall.bat。

redis-server --service-uninstall

 

相关文章

文章浏览阅读2.2k次,点赞6次,收藏20次。在我们平时办公工作...
文章浏览阅读1k次。解决 Windows make command not found 和...
文章浏览阅读3.2k次,点赞2次,收藏6次。2、鼠标依次点击“计...
文章浏览阅读1.3w次。蓝光版属于高清版的一种。BD英文全名是...
文章浏览阅读974次,点赞7次,收藏8次。提供了更强大的功能,...
文章浏览阅读1.4w次,点赞5次,收藏22次。如果使用iterator的...