如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
如何在Windows上运行Redis ?Redis下载页面似乎提供了*nix选项。
我可以在Windows上本地运行Redis吗?
当前回答
摘自:http://avenshteinohad.blogspot.com/2016/01/redis-jedis-quickstart.html
如果您使用windows,请使用MSOpenTech版本: https://github.com/MSOpenTech/redis
你可能还会发现这篇文章对入门基本命令很有用。
其他回答
如果你对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 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服务已经安装,我们可以从服务管理器中操作它
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").
下载并安装Redis后,签出Redis安装文件夹中的文档文档。你可以在那里找到关于如何启动和停止redis-server的一切。 如果你是通过。exe文件安装的Redis,很有可能你已经在运行它了。要确定Redis服务器是否正在运行,请检查任务管理器->服务选项卡。
在状态字段下,您可以看到它是否正在运行。如果它停止了,右键单击它并启动服务。
可以在Redis -cli下编写Redis命令,也可以在终端类型下打开Redis -cli:
C:\Program Files\Redis\redis-cli.exe
为了方便访问,您可以添加Redis安装目录作为环境变量。
You can use Memurai for Windows, a Redis-compatible cache and datastore for Windows, currently compatible with Redis 5. Memurai aims to fulfill the need for a supported Redis-compatible datastore on the Windows platform. At its core, it’s based on Redis source code, ported to run natively on Windows, and it’s designed to provide the level of reliability and performance required for production environments. Memurai is free for development and testing. You can learn more and download Memurai at https://www.memurai.com.
亚历克西斯Campailla CEO, Memurai