標籤:
win 7 安裝redis服務
Redis是一個開源的使用ANSI C語言編寫、支援網路、可基於記憶體亦可持久化的日誌型、Key-Value資料庫,並提供多種語言的API。但是Redis官方是不支援windows的,只是 Microsoft Open Tech group 在 GitHub上開發了一個Win64的版本,項目地址是: https://github.com/MSOpenTech/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 offfor /f "skip=3 tokens=4" %%i in (‘sc query Redis‘) do set "zt=%%i" &goto :next:nextif /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服務