【软件安装与配置】Redis for Windows

1. 下载 Redis

Redis 官方没有直接支持 Windows 的安装程序,但可以使用第三方的 Windows 版本。推荐使用 Memurai 或从 Microsoft archive 提供的 Redis for Windows 下载。

2. 安装 Redis

下载适合 Windows 的安装包,本文以Microsoft archive安装包为例。

  • 下载后双击安装,全选默认即可,记得选择"添加Redis目录到环境变量PATH中"。

3. 启动 Redis

安装完成后,进入到Redis安装目录,通过命令行启动 Redis 服务器。

cmd 复制代码
E:\golang\Redis>redis-server
[36868] 21 Oct 14:47:56.306 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 3.0.504 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 36868
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           http://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

[36868] 21 Oct 14:47:56.309 # Server started, Redis version 3.0.504
[36868] 21 Oct 14:47:56.310 * The server is now ready to accept connections on port 6379

4. 设置为 Windows 服务(可选)

如果希望 Redis 自动在 Windows 启动时运行,将 Redis 设置为 Windows 服务:

cmd 复制代码
E:\golang\Redis>redis-server --service-start
[57972] 21 Oct 15:04:14.546 # Redis service successfully started.

5. 测试 Redis 连接

使用 redis-cli 来测试 Redis 是否正常运行:

cmd 复制代码
E:\golang\Redis>redis-cli
127.0.0.1:6379> PING
PONG

如果 Redis 正常运行,会返回 PONG。

相关推荐
2501_903238658 分钟前
Git Bash:Windows下的强大命令行工具
windows·git·bash·个人开发
甜可儿9 分钟前
redis序列化设置
数据库·redis
GGBondlctrl14 分钟前
【SpringBoot】论坛项目中如何进行实现发布文章,以及更新对应数据库的数据更新
数据库·springboot项目·三层设计思想·文章发布项目
若云止水27 分钟前
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_init_cycle 函数 - 详解(4)
数据库·nginx·ubuntu
jay丿1 小时前
Django模板系统深入
数据库·django·sqlite
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19
千层冷面1 小时前
Redis除了做缓存还能做什么?
数据库·redis·缓存
吃汤圆的抹香鲸1 小时前
Rider 安装包 绿色版 Win/Mac/Linux 适合.NET和游戏开发者使用 2025全栈开发终极指南:从零配置到企业级实战
linux·运维·windows·sql·游戏·macos·.net
码有余悸3 小时前
Redis:高性能的键值存储系统
数据库·redis·缓存
剑客狼心7 小时前
Oracle:什么是存储过程
数据库·oracle