如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
如何在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
注:如果安装有任何错误,请参阅本文。
其他回答
也许有点晚了,但是我能够在Windows 10周年更新上运行Redis。 Windows 10周年更新附带Bash,简单地说,它附带Bash。 以下是我遵循的两个教程: 1-如何在Windows 10操作系统上安装和使用Linux Bash Shell 2-如何安装和使用Redis 下面是运行Redis的图片。 享受:)
今天我知道这4个选择:
第一个是tporadowski/redis上的开源分支,提供了与版本5的兼容性(版本6正在开发中)。
第二个是memurai(付费),与版本5兼容,支持和一个免费版本的开发。
第三个是最近发布的zkteco-home/redis-windows,它提供了与版本7的兼容性,但不是开源的。
也可以选择通过WSL运行。但是我不建议在生产环境中使用它。
安装 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,这让我想起了Redis团队的建议:
Redis在虚拟机上运行速度较慢。虚拟化的代价是相当高的,因为许多常见的操作。(…)更喜欢在物理机上运行Redis,特别是如果你喜欢确定性延迟。在最先进的管理程序(VMWare)上,通过物理网络对虚拟机进行红色基准测试的结果几乎是物理机器的2倍,在系统和中断上花费了大量的CPU时间。
更新
如果你有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服务已经安装,我们可以从服务管理器中操作它