如果需要配置访问密码等,请参考:  Redis单机版简单安装脚本

Redis对于Linux是官方支持的,安装和使用没有什么好说的,普通使用按照官方指导,5分钟以内就能搞定。详情请参考:

http://redis.io/download

但有时候又想在windows下折腾下Redis,可以从redis下载页面看到如下提示(在页面中搜索 "windows"):

[plain] view plaincopy
  1. Win64   Unofficial  The Redis project does not directly support Windows,
  2. however the Microsoft Open Tech group develops and maintains
  3. an Windows port targeting Win64.

大意就是 Redis官方是不支持windows的,只是 Microsoft Open Tech group 在 GitHub上开发了一个Win64的版本,项目地址是:

https://github.com/MSOpenTech/redis

打开以后,可以直接使用浏览器下载,或者git克隆。

可以在项目主页右边找到 zip包下载地址: https://github.com/MSOpenTech/redis/archive/2.8.zip

(注意: dist文件改变了下载地址: https://github.com/MSOpenTech/redis/releases )

在 Release 页面中,可以找到 msi 安装文件以及 .zip 文件(而且有3.0的beta版,请下拉查找)。

下载解压,没什么好说的,在解压后的bin目录下有以下这些文件:

[plain] view plaincopy
  1. redis-benchmark.exe         #基准测试
  2. redis-check-aof.exe         # aof
  3. redis-check-dump.exe        # dump
  4. redis-cli.exe               # 客户端
  5. redis-server.exe            # 服务器
  6. redis.windows.conf          # 配置文件

当然,还有一个 RedisService.docx 文件,看似是一些启动和安装服务的说明文档,但是照着他的指示来,你就会死的很惨,莫名其妙的死了,不知道原因。

【换机器重新测试后已查明,如果不是Administrator用户,就会出各种问题,服务安装以后启动不了等等问题,应该可以修改服务的属性-->登录用户等选项来修正.】

【如果你安装的windows没有Administrator账户,请参考这篇文章:

Windows 7 启用超级管理员administrator账户的N种方法

网上参考了一些资料,发觉可以使用,也就没有深究,直接拿来主义:

启动脚本如下:

[plain] view plaincopy
  1. redis-server  redis.windows.conf

可以将其保存为文件  startup.bat  ; 下次就可以直接启动了。

但是在cmd之中执行这行命令之后报错:

[plain] view plaincopy
  1. D:\Develop\redis-2.8.12>redis-server.exe redis.windows.conf
  2. [7736] 10 Aug 21:39:42.974 #
  3. The Windows version of Redis allocates a large memory mapped file for sharing
  4. the heap with the forked process used in persistence operations. This file
  5. will be created in the current working directory or the directory specified by
  6. the 'dir' directive in the .conf file. Windows is reporting that there is
  7. insufficient disk space available for this file (Windows error 0x70).
  8. You may fix this problem by either reducing the size of the Redis heap with
  9. the --maxheap flag, or by starting redis from a working directory with
  10. sufficient space available for the Redis heap.
  11. Please see the documentation included with the binary distributions for more
  12. details on the --maxheap flag.
  13. Redis can not continue. Exiting.

根据提示,是 maxheap 标识有问题,打开配置文件  redis.windows.conf , 搜索  maxheap  , 然后直接指定好内容即可.

[plain] view plaincopy
  1. .......
  2. #
  3. # maxheap <bytes>
  4. maxheap 1024000000
  5. .......

然后再次启动,OK,成功.

[plain] view plaincopy
  1. D:\Develop\redis-2.8.12>redis-server  redis.windows.conf
  2. _._
  3. _.-``__ ''-._
  4. _.-``    `.  `_.  ''-._           Redis 2.8.12 (00000000/0) 64 bit
  5. .-`` .-```.  ```\/    _.,_ ''-._
  6. (    '      ,       .-`  | `,    )     Running in stand alone mode
  7. |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
  8. |    `-._   `._    /     _.-'    |     PID: 6736
  9. `-._    `-._  `-./  _.-'    _.-'
  10. |`-._`-._    `-.__.-'    _.-'_.-'|
  11. |    `-._`-._        _.-'_.-'    |           http://redis.io
  12. `-._    `-._`-.__.-'_.-'    _.-'
  13. |`-._`-._    `-.__.-'    _.-'_.-'|
  14. |    `-._`-._        _.-'_.-'    |
  15. `-._    `-._`-.__.-'_.-'    _.-'
  16. `-._    `-.__.-'    _.-'
  17. `-._        _.-'
  18. `-.__.-'
  19. [6736] 10 Aug 22:01:22.247 # Server started, Redis version 2.8.12
  20. [6736] 10 Aug 22:01:22.248 * The server is now ready to accept connections on port 6379

然后可以使用自带的客户端工具进行测试。

双击打开 redis-cli.exe , 如果不报错,则连接上了本地服务器,然后测试,比如 set命令,get命令:

[plain] view plaincopy
  1. 127.0.0.1:6379> set tiemao http://blog.csdn.net/renfufei
  2. OK
  3. 127.0.0.1:6379> get tiemao
  4. "http://blog.csdn.net/renfufei"
  5. 127.0.0.1:6379>

这应该很好理解,连接上了本机的6379端口。

如果需要帮助,可以在 cli窗口中输入 help查看,例如:

[plain] view plaincopy
  1. 127.0.0.1:6379> help
  2. redis-cli 2.8.12
  3. Type: "help @<group>" to get a list of commands in <group>
  4. "help <command>" for help on <command>
  5. "help <tab>" to get a list of possible help topics
  6. "quit" to exit
  7. 127.0.0.1:6379> help @string

根据提示,可以输入 help 空格 然后敲tab键,可以像命令提示一样告诉你可以有哪些帮助分组,多敲几个 tab 试试?
备注说明:

1. 这个版本是Win64的,所以32位windows就不要折腾了。

2. 我的操作系统是Windows 7 64位旗舰版,运行内存16GB,用户不是Administrator,而是 hasee,所以设置了下 redis-server.exe 和redis-cli.exe 的属性中的兼容性权限(以管理员身份运行),如果你运行出错,可能需要设置一下这里。

3. 什么360啊,UAC啊,防火墙啊,该关的请关闭。。。

4. 如果有其他问题,欢迎留言或者评论, 这只是一个心血来潮时的折腾
接触了好久Redis但一直没在windows下使用,请轻拍。

附加几个 bat 批处理脚本,请根据需要灵活配置

service-install.bat

[plain] view plaincopy
  1. redis-server.exe --service-install redis.windows.conf --loglevel verbose

uninstall-service.bat

[plain] view plaincopy
  1. redis-server --service-uninstall

startup.bat

[plain] view plaincopy
  1. redis-server.exe redis.windows.conf

Windows下安装并设置Redis相关推荐

  1. windows下安装和配置Redis

    一.下载windows版本的Redis 官网上不提供windows版本的,现在官网没有下载地址,只能在github上下载,官网只提供linux版本的下载    官网下载地址:redis.io/down ...

  2. windows下安装和设置gradle

    一.安装前检查 检查jdk是否已经安装 二.下载gradle 1. https://gradle.org/releases/ 2.设置gradle环境变量 3. 环境变量中增加名为GRADLE_HOM ...

  3. Redis第一集:Windows下安装Redis和测试

    Redis第一集:Windows下安装Redis和测试 一.资源 Windows下的Redis的下载地址 点击这里即可下载,如果进不去GitHub的话,可以上网搜一下怎么进GitHub,搭个梯子(●ˇ ...

  4. Redis在windows下安装与配置 (转)

    Redis在windows下安装与配置 原文地址:https://www.cnblogs.com/lezhifang/p/7027903.html 一.安装Redis 1. Redis官网下载地址:h ...

  5. Windows下安装Redis服务(zip)

    Windows下安装Redis服务(zip) 1.官方没有 Windows版本的 Redis,官网介绍: Redis项目不正式支持Windows.但是,微软开发并维护了针对Win64的Windows版 ...

  6. Windows下安装Redis及使用Python操作Redis的方法

    这篇文章主要介绍了Windows下安装Redis及使用Python操作Redis的方法,非常不错,具有参考借鉴价值,需要的朋友可以参考下 首先说一下在Windows下安装Redis,安装包可以在htt ...

  7. windows下安装php5.5的redis扩展

    windows下开发用的xampp集成的环境,想装个php-redis扩展,扩展的github地址: https://github.com/nicolasff/phpredis php_redis.d ...

  8. 【django】Windows下安装Redis

    博客园 首页 新随笔 联系 订阅 管理 随笔 - 4  文章 - 0  评论 - 0 Windows下安装Redis 一.Redis简单介绍: Redis是一个Key-value的数据结构存储系统,可 ...

  9. 设置windows引导linux分区,windows下安装grub引导Linux

    在安装Linux和windows双系统时通常是先安装windows再安装Linux,因为windows会对主引扇区录进行充0,因而破坏主引导记录.当安装完windows再安装Linux,Linux会将 ...

最新文章

  1. 选择通过更改内容类型返回的详细程度,第二部分
  2. [js] 在不支持js的浏览器中如何隐藏JavaScript代码?
  3. TLS 1.3套件TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256
  4. Vue中条件判断 v-if 、v-show
  5. Luogu P4403 [BJWC2008]秦腾与教学评估【二分答案】By cellur925
  6. iOS 10越狱设备终于有越狱移除工具了!
  7. 微信接口开发,config提示OK,但分享不成功
  8. 终极讲师介绍:集齐 27 位大神召唤亚洲首届 Rust 开发者大会!
  9. php session fixation,Session Fixation 攻防实战
  10. html文档注释多行,css注释的写法(单行和多行)
  11. 《MyBatis 从入门到精通》
  12. 从源码解析-Android系统启动流程概述 init进程zygote进程SystemServer进程启动流程
  13. 毕业设计---基于人脸识别的Web端考勤系统
  14. error C2143/C2501/C2059/C2238
  15. NOI2017酱油记(伪)
  16. Android 批量打包 基于Walle的多渠道快速打包自动脚本
  17. 在嵌入式x86上构建我的智能家居(home assistant) (三)
  18. angular使用service应用分层
  19. java基于安卓Android/微信小程序的高校校园跑腿系统 uniapp
  20. Dva + React + Mock 搭建项目 (主要讲解DvaJs)

热门文章

  1. 第五章 软件下载与安装(二、VM安装Ubuntu16.4)
  2. Nginx和lvs在负载均衡方面的对比
  3. 打开和关闭Oracle Flashback
  4. Spotlight on oracle 使用
  5. 解决windows7您当前无权访问该文件夹的问题
  6. 解决.NET CF 3.5 Bitmap(Stream)未处理异常问题
  7. Web开发工具包收藏
  8. linux whois rpm,CentOS系统安装whois命令的方法
  9. python删除字符串中的空格保留一个_Python从字符串中隔开的字母中删除单个空格的最快方法...
  10. centos 忘记root密码_Linux忘记root密码解决方案