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

我可以在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版本的合并,并修复了一些错误。

其他回答

如果你有Windows Linux子系统(WSL),本机在Windows 10和Windows Server 2019上,你可以这样做:

设置WSL:

To enable Windows Subsystem for Linux, follow the instructions on Microsoft Docs. The short version is: In Windows 10, Microsoft replaces Command Prompt with PowerShell as the default shell. Open PowerShell as Administrator and run this command to enable Windows Subsystem for Linux (WSL): Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Reboot Windows after making the change—note that you only need to do this one time. Download and install one of the supported Linux distros from the Microsoft Store. Ubuntu works fine. Note that Ubuntu 20.04 LTS may give you some trouble because of a known issue with the realtime clock (as of August 2020). Choosing Ubuntu 18.04 LTS instead avoids that issue.

安装和测试Redis:

Launch the installed distro from your Windows Store and then install redis-server. The following example works with Ubuntu (you’ll need to wait for initialization and create a login upon first use): > sudo apt-get update > sudo apt-get upgrade > sudo apt-get install redis-server > redis-cli -v Restart the Redis server to make sure it is running: > sudo service redis-server restart Execute a simple Redis command to verify your Redis server is running and available: $ redis-cli 127.0.0.1:6379> set user:1 "Oscar" 127.0.0.1:6379> get user:1 "Oscar" To stop your Redis server: > sudo service redis-server stop

来源:

https://redislabs.com/blog/redis-on-windows-10/

https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux

更新

如果你有Windows Linux子系统(WSL),本机在Windows 10和Windows Server 2019上,你可以按 Ogglas回答

或者按照这些说明在微软Windows上运行Redis数据库

Turn on Windows Subsystem for Linux In Windows 10, Microsoft replaced Command Prompt with PowerShell as the default shell. Open PowerShell as Administrator and run this command to enable Windows Subsystem for Linux (WSL): Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Reboot Windows after making the change — note that you only need to do this once. Launch Microsoft Windows Store start ms-windows-store: Then search for Ubuntu, or your preferred distribution of Linux, and download the latest version. Install Redis server Installing Redis is simple and straightforward. The following example works with Ubuntu (you'll need to wait for initialization and create a login upon first use): sudo apt-add-repository ppa:redislabs/redis sudo apt-get update sudo apt-get upgrade sudo apt-get install redis-server Please note that the sudo command might or mightn't be required based on the user configuration of your system. Restart the Redis server Restart the Redis server as follows: sudo service redis-server restart Verify if your Redis server is running Use the redis-cli command to test connectivity to the Redis database. $ redis-cli 127.0.0.1:6379> set user:1 "Ben" 127.0.0.1:6379> get user:1 "Ben" Please note: By default, Redis has 0-15 indexes for databases, you can change that number of databases NUMBER in redis.conf. Stop the Redis Server sudo service redis-server stop

来源:如何在Windows上安装Redis


我找到了一个在Windows下安装Redis的更简单的方法

下载最新的Redis .msi文件

https://github.com/MSOpenTech/redis/releases

后安装。Redis服务已经安装,我们可以从服务管理器中操作它

我认为这是在Windows上运行Redis的两种最简单的方法

1 -本地(更新)端口的Windows

如选项3所述,运行微软的Redis本机端口:

下载redis原生64位Windows端口redis-latest.zip wget https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip 解压redis64-latest.zip到任何文件夹,例如在c:\redis 使用本地配置运行redis-server.exe cd c: \复述 redis-server.exe redis.conf 运行redis-cli.exe连接到你的redis实例 cd c: \复述 redis-cli.exe

2 -与流浪者

你可以在Windows上用Vagrant使用Redis,如下所述:

在Windows上安装Vagrant 下载vagrant-redis.zip vagrant配置文件 wget https://raw.github.com/ServiceStack/redis-windows/master/downloads/vagrant-redis.zip 将vagrant-redis.zip解压到任意文件夹,例如c:\vagrant-redis 使用vagrant启动Virtual Box VM: cd c: \ vagrant-redis 流浪汉了 这会在Virtual Box中启动一个新的Ubuntu VM实例 自动安装并启动最新的稳定版本的redis。

在Windows系统上安装Redis遵循以下步骤:

访问以下链接之一:

https://github.com/MSOpenTech/redis/releases(推荐) https://github.com/rgl/redis/downloads

下载MSI文件。 按照安装向导在您的系统上安装该程序。(不要更改安装路径为“C:\Program Files\Redis”) 在开始菜单上搜索“编辑系统环境变量” 点击“环境变量”按钮 选择“路径”,点击“编辑” 现在点击“新建” 粘贴C:\Program Files\Redis(如果在安装时更改了路径) 点击“ok”,“ok”和“ok”

现在打开终端(命令提示符)并运行redis-cli

好吧,我得到一些错误打开redis-server(它一直工作得很好,直到现在,但不确定什么是错误的,所以弄清楚并将更新这个答案)

最新的Redis x86版本(32位)可以在这里找到: http://bitsandpieces.it/redis-x86-32bit-builds-for-windows

他说他会保持两个2.8。*和3.0。*分支。