您现在的位置是:网站首页> 编程资料编程资料

win 7 安装redis服务【笔记】_Redis_

2023-05-27 662人已围观

简介 win 7 安装redis服务【笔记】_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 地址如图:
github redis window版

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

安装 redis解压文件

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

redis目录

新建批处理文件

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 

-六神源码网