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

相关推荐
假如梵高是飞行员6 分钟前
WSL2 从 img 镜像文件启动特定 Linux 发行版完整指南
linux·windows·wsl
执子手 吹散苍茫茫烟波30 分钟前
常见的数据库隔离级别以及企业里常用的是什么方案
数据库
Database_Cool_1 小时前
数据库慢查询优化首选方案:阿里云 RDS 性能洞察+自动诊断
数据库·人工智能·阿里云
YOU OU1 小时前
Redis初识
数据库·redis·缓存
长孙豪翔1 小时前
在.net中读写config文件的各种方法
java·数据库·.net
深盾科技_Virbox2 小时前
加密狗授权能力选型:从授权模型到全生命周期管理
java·网络·数据库
峥无2 小时前
深入理解MySQL事务与MVCC机制
数据库·mysql
行思理3 小时前
MongoDB 大数据备份,新手教程
数据库·mongodb
-To be number.wan3 小时前
数据库系统 | 规范化理论
数据库·学习
城数派4 小时前
1950-2026年中国0.1°逐月平均气温栅格数据集
数据库·信息可视化