Redis被数百万开发人员用作缓存、矢量数据库、文档数据库、流媒体引擎和消息代理的开源内存数据存储。
1、下载redis
官网:https://redis.io/
Redis 官方网站没有提供 Windows 版的安装包,可以通过 GitHub 来下载 Windows 版 Redis 安装包,下载地址:https://github.com/redis-windows/redis-windows/releases。
2、安装redis
(1)解压、重命名为Redis。
(2)安装服务
以管理员身份运行cmd,切换到D:\Redis(笔者redis放在d盘的,命令:cd /d D:\Redis)
安装redis服务
将RedisService.exe改为您实际存放的路径
sc.exe create Redis binpath=D:\Redis\RedisService.exe start= auto
设置redis密码
需要注意的是,redis默认情况下是不需要输入密码的,可以在redis.windows.conf中进行设置。
修改redis.conf文件中的requirepass字段。
启动服务
net start Redis
停止服务
net stop Redis
卸载服务
sc.exe delete Redis
(3)配置环境变量
将 Redis 加入到环境变量中,根据Redis的安装路径添加环境变量
参考资料:
https://github.com/redis-windows/redis-windows/blob/main/README.zh_CN.md