【软件安装与配置】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。

相关推荐
DemonAvenger6 小时前
NoSQL与MySQL混合架构设计:从入门到实战的最佳实践
数据库·mysql·性能优化
AAA修煤气灶刘哥17 小时前
别让Redis「歪脖子」!一次搞定数据倾斜与请求倾斜的捉妖记
redis·分布式·后端
AAA修煤气灶刘哥17 小时前
后端人速藏!数据库PD建模避坑指南
数据库·后端·mysql
RestCloud21 小时前
揭秘 CDC 技术:让数据库同步快人一步
数据库·api
得物技术1 天前
MySQL单表为何别超2000万行?揭秘B+树与16KB页的生死博弈|得物技术
数据库·后端·mysql
christine-rr1 天前
linux常用命令(4)——压缩命令
linux·服务器·redis
可涵不会debug1 天前
【IoTDB】时序数据库选型指南:工业大数据场景下的技术突围
数据库·时序数据库
ByteBlossom1 天前
MySQL 面试场景题之如何处理 BLOB 和CLOB 数据类型?
数据库·mysql·面试
麦兜*1 天前
MongoDB Atlas 云数据库实战:从零搭建全球多节点集群
java·数据库·spring boot·mongodb·spring·spring cloud
Slaughter信仰1 天前
深入理解Java虚拟机:JVM高级特性与最佳实践(第3版)第十章知识点问答(10题)
java·jvm·数据库