华域联盟 Redis win 7 安装redis服务【笔记】

win 7 安装redis服务【笔记】

win 7 安装redis服务

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

win 7 安装redis服务目录下载 redis安装 redis解压文件新建批处理文件

下载 redis

打开 https://github.com/MSOpenTech/redis 地址如图:

点击releases 选择相应的版本(以Redis-x64-3.0.501.zip为例):

安装 redis解压文件

将下载的压缩文件解压到安装目录下, 例如:我安装在E:\service\Redis-x64-3.0.501

新建批处理文件

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

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

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

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

redis-server --service-uninstall

本文由 华域联盟 原创撰写:华域联盟 » win 7 安装redis服务【笔记】

转载请保留出处和原文链接:https://www.cnhackhy.com/155937.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们