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

相关推荐
不羁。。3 小时前
【撸靶笔记】第七关:GET - Dump into outfile - String
数据库·笔记·oracle
yangchanghua1115 小时前
pgsql 如何查询今天范围内的数据(当天0点0分0秒 - 当天23点59分59秒....)
数据库·pgsql
larance5 小时前
SQLAlchemy 的异步操作来批量保存对象列表
数据库·python
python_chai5 小时前
从数据汇总到高级分析,SQL 查询进阶实战(下篇)—— 分组、子查询与窗口函数全攻略
数据库·sql·mysql
在努力的前端小白5 小时前
Spring Boot 敏感词过滤组件实现:基于DFA算法的高效敏感词检测与替换
java·数据库·spring boot·文本处理·敏感词过滤·dfa算法·组件开发
未来之窗软件服务5 小时前
自建知识库,向量数据库 (九)之 量化前奏分词服务——仙盟创梦IDE
数据库·仙盟创梦ide·东方仙盟·自建ai·ai分词
搏博5 小时前
基于Python3.10.6与jieba库的中文分词模型接口在Windows Server 2022上的实现与部署教程
windows·python·自然语言处理·flask·中文分词
冒泡的肥皂8 小时前
MVCC初学demo(一
数据库·后端·mysql
.Shu.9 小时前
Redis Reactor 模型详解【基本架构、事件循环机制、结合源码详细追踪读写请求从客户端连接到命令执行的完整流程】
数据库·redis·架构
薛晓刚12 小时前
当MySQL的int不够用了
数据库