如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。

我可以在Windows上本地运行Redis吗?


当前回答

安装 Redis

窗户

⚫Windows 8.1及以前版本

Download Redis (msi) from the link https://github.com/MicrosoftArchive/redis/releases Run the installer Open the folder where Redis has been installed and Start redis-server to check if redis is working by clicking on redis-server Stop Redis server by typing SHUTDOWN SAVE or force quit by CTRL + C Open Start Type Environment Variables and click on edit environment variables and path Inside System variables, click on path In the next window click on new. Add a new path C:\Program Files\{Your Redis Version} Where Redis Version is the Redis version installed on your system For e.g. C:\Program Files\Redis-x64-3.2.100 Verify That Setup was Successful Check by typing redis-cli or redis-server

⚫ 视窗 10

Step Up WSL

a.以Administrator用户运行Windows Powershell

b.执行以下命令

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

c.修改完成后重新启动Windows

d.从windows商店https://www.microsoft.com/en-us/p/ubuntu-1804/9n9tngvndl3q?activetab=pivot%3Aoverviewtab下载Ubuntu发行版

安装和测试Redis

a.启动下载的发行版,执行如下命令

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install redis-server
redis-cli -v

注:如果安装有任何错误,请参阅本文。

其他回答

从历史上看,微软有一个redis的Windows移植版本,它以redis -64的形式发布,为Windows提供了一个完整的redis发行版。

微软的移植版本现在已被弃用,但已经出现了一些替代方案来填补这一空白:

Memurai是Redis-64弃用页面上官方推荐的替代方案;它是一个带有免费开发者层的商业产品,由Janea Systems维护 Redis-windows是另一个非官方的端口,它也存在


此版本包括Redis -server.exe (Memurai上的Memurai .exe)应用程序,在您的windows机器上运行Redis实例作为服务,以及Redis -cli.exe (Memurai上的Memurai -cli.exe),您可以使用它与任何Redis实例进行交互。

RGL存储库历史上被列为Redis的替代Windows端口,但这个存储库已经有一段时间没有维护了,并且实现了比微软端口更老的Redis版本。

由于mopentech的Redis端口不再维护-任何对Redis Windows本机端口感兴趣的人现在可以从这里获得4.0.14和5.0.10版本:https://github.com/tporadowski/redis/releases。 这个分叉是MSOpenTech的最新3.2.100版本和antirez/redis的4.0.14/5.0.10版本的合并,并修复了一些错误。

you can install Redis by following this article: https://github.com/ServiceStack/redis-windows but for going straight, you can download it by this link: https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip after downloading, go to the directory which you like to put your files,then extract the zip file, then open a command prompt and go to the directory where you extracted your file, then type "redis-server" and hit enter(for opening redis-cli open command and route to redis directory, but instead of "redis-server" execute "redis-cli").

如果你对Powershell有点满意,你也可以使用Powershell和chocoley得到最新的Windows二进制文件。

首先,按照下面的说明(一个简单的命令行,如admin)将chocolatey添加到Powershell: https://chocolatey.org/

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

然后,使用Powershell从chocolatey获取redis包:http://chocolatey.org/packages/redis-64

choco install redis-64

Redis将被安装在C:\ProgramData\chocolatey\lib\ Redis -64.2.8.9这样的目录中

Windows PowerShell Copyright (C) 2013 Microsoft Corporation. All rights reserved. PS C:\windows\system32> choco install redis-64 Chocolatey (v0.9.8.27) is installing 'redis-64' and dependencies. By installing you accept the license for 'redis-64' an d each dependency you are installing. redis-64 v2.8.9 Added C:\ProgramData\chocolatey\bin\redis-benchmark.exe shim pointed to '..\lib\redis-64.2.8.9\redis-benchmark.exe'. Added C:\ProgramData\chocolatey\bin\redis-check-aof.exe shim pointed to '..\lib\redis-64.2.8.9\redis-check-aof.exe'. Added C:\ProgramData\chocolatey\bin\redis-check-dump.exe shim pointed to '..\lib\redis-64.2.8.9\redis-check-dump.exe'. Added C:\ProgramData\chocolatey\bin\redis-cli.exe shim pointed to '..\lib\redis-64.2.8.9\redis-cli.exe'. Added C:\ProgramData\chocolatey\bin\redis-server.exe shim pointed to '..\lib\redis-64.2.8.9\redis-server.exe'. Finished installing 'redis-64' and dependencies - if errors not shown in console, none detected. Check log for errors if unsure

然后运行服务器

redis-server

或者使用CLI

redis-cli

按照C:\ProgramData\chocolatey\lib\redis-64.2.8.9\RedisService.docx中的说明安装redis服务

你可以通过以下步骤在windows中安装redis。

下载Redis zip文件。点击这里! 解压zip文件到准备好的目录。 运行redis-server.exe,可以通过单击直接运行redis-server.exe,也可以通过命令提示符运行。

成功运行redis-server. exe后,运行redis-cli.exe。您可以通过运行redis-cli.exe test来访问它并测试命令 PING命令用于检测连接是否存在。