如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
当前回答
下载并安装Redis后,签出Redis安装文件夹中的文档文档。你可以在那里找到关于如何启动和停止redis-server的一切。 如果你是通过。exe文件安装的Redis,很有可能你已经在运行它了。要确定Redis服务器是否正在运行,请检查任务管理器->服务选项卡。
在状态字段下,您可以看到它是否正在运行。如果它停止了,右键单击它并启动服务。
可以在Redis -cli下编写Redis命令,也可以在终端类型下打开Redis -cli:
C:\Program Files\Redis\redis-cli.exe
为了方便访问,您可以添加Redis安装目录作为环境变量。
其他回答
更新
如果你有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子系统for Linux(a.k.)在Windows 10上安装Redis。WSL2)。WSL2是一个兼容层,用于在Windows 10和Windows Server 2019上本机运行Linux二进制可执行文件。WSL2允许开发人员直接在Windows上运行GNU/Linux环境(包括命令行工具、实用程序和应用程序)。
按照下面的链接在微软Windows 10上创建Redis数据库https://developer.redislabs.com/create/windows
似乎这是获得最新版本的Redis最简单的方法-使用NuGet管理器:
1)打开NuGet设置页面,下载命令行实用程序 (nuget.exe命令行工具的最新版本始终可从https://nuget.org/nuget.exe获得)
2)将此文件复制到某个地方(例如C:\Downloads)
3)以管理员身份启动命令提示符并执行以下命令:
cd C:\Downloads
nuget.exe install redis-64
4)在下载文件夹将是最新版本的Redis (C:\Downloads\Redis-64.2.8.19在我的情况下)
5)运行redis-server.exe并开始工作
附注:下载的redis for windows包含一个非常旧的redis版本:2.4.6
我认为这是在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。
我正在使用Memurai,这是redis兼容的缓存和Windows的数据存储。微软开放技术也推荐它,因为它写在他们以前的项目这里。
这个项目不再被积极维护。如果你是 寻找Windows版本的Redis,你可能想看看 Memurai。请注意,微软并没有正式认可这一点 任何形式的产品。