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

要在Windows上下载和安装Redis,您可以按照以下步骤进行操作: 1. 首先,您需要访问Redis的官方网站以下载最新版的Redis。您可以在网站上找到一个名为"Download"或"Downloads"的标签,点击进入下载页面。 2. 在下载页面上,您会看到不同版本的Redis可供选择。根据您的需求,选择适用于Windows的版本进行下载。通常,您可以选择一个Windows的.zip压缩文件,例如中提到的"windows-redis-6.2.7.zip"。 3. 下载完成后,解压缩下载的zip文件。您可以选择将解压缩后的文件放置在任意位置,例如 C:\Redis。 4. 接下来,打开一个命令提示符窗口(CMD)或者PowerShell,导航到您刚刚解压缩的Redis文件夹所在的位置。您可以使用"cd"命令来切换目录。 5. 在命令提示符窗口中,输入 redis-server.exe redis.windows.conf 命令来启动Redis服务器。这将使用Redis默认配置文件启动服务器。 6. 如果一切顺利,您将看到Redis服务器成功启动的信息。 7. 现在,您可以打开另一个命令提示符窗口或者PowerShell窗口,导航到Redis文件夹,然后输入 redis-cli.exe 命令来启动Redis客户端。 8. 一旦Redis客户端启动,您可以开始使用Redis的命令行界面进行交互了。例如,您可以使用"SET"命令来设置键值对,使用"GET"命令来获取键的值等等。 这样,您就成功在Windows上下载和安装了Redis。请记住,您可以根据实际需要进行配置和使用Redis。祝您使用愉快! : 最新版windows windows-redis-6.2.7.zip
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值