Windows下载安装 redis

Windows下载安装 redis

Windows 64位操作系统

下载redis 文件

https://github.com/microsoftarchive/redis/releases

新建文件夹 redis
将内容cp到新建的文件夹里

测试运行
1 运行cmd命令 切换到redis这个文件夹下

运行 redis-server.exe redis.windows.conf
(备注:通过这个命令,会创建Redis临时服务,不会在window Service列表出现Redis服务名称和状态,此窗口关闭,服务会自动关闭。 测试完成后 可以使用 redis-server --service-start 手动启动)
在这里插入图片描述
报错

  The Windows version of Redis allocates a memory mapped heap 	for sharing with the forked process used for persistence operations. In order to share this memory, Windows allocates from the system paging file a portion equal to the size of the Redis heap. At this time there is insufficient contiguous free space available in the system paging file for this operation (Windows error 0x5AF). To work around this you may either increase the size of the system paging file, or decrease the size of the Redis heap with the --maxheap flag.Sometimes a reboot will defragment the system paging file sufficiently for this operation to complete successfully.
Please see the documentation included with the binary distributions for more details on the --maxheap flag.
Redis can not continue. Exiting.

经查,是因为系统内存不足引起的,可以通过添加启动参数解决:
redis-server.exe redis.windows.conf --maxheap 1gb
maxheap参数可以带单位也可以不带单位,不带单位默认为字节。

2 开始一个新的cmd窗口 切换到redis这个文件夹下

运行 redis-cli.exe -h 127.0.0.1 -p 6379

测试运行
设置键值对 set myKey abc
取出键值对 get myKey
如下图 运行成功
在这里插入图片描述

这时候,windows环境下,redis的服务端和客户端都运行成功了。

redis 开机自启

redis-server --service-install redis.windows.conf --loglevel verbose

手动启动redis

redis-server --service-start

停止服务

redis-server  --service-stop

卸载服务

redis-server --service-uninstall
php安装redis扩展可查看下面

https://blog.csdn.net/huangkang1995/article/details/109185299

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值