redis 在 windows 中的安装
redis 在 windows 中的安装
redis 官方并没有提供 redis 的 windows 版本。但是微软提供了 redis 的 windows 版本。有2.8和3.0版本。3.0版本支持集群。
微软提供的redis的windows版本地址
https://github.com/microsoftarchive/redis/releases

下载后解压

启动
# 指定配置文件
D:\chengxu\redis-3.0.504-x64>redis-server redis.windows.conf
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.504 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 10072
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
[10072] 19 Oct 20:51:38.828 # Server started, Redis version 3.0.504
[10072] 19 Oct 20:51:38.832 * The server is now ready to accept connections on port 6379
# 双击redis-cli.exe 打开客户端成功
127.0.0.1:6379> set foo 1
OK
设置服务
Windows Service Documentation.docx 文档中有描述。
安装服务
# 默认服务名为redis
D:\chengxu\redis-3.0.504-x64>redis-server --service-install redis.windows-service.conf --loglevel verbose
# 指定服务名为Redis3.0 端口号为6381
D:\chengxu\redis-3.0.504-x64>redis-server --service-install redis.windows.conf --loglevel verbose --port 6381 --service-name Redis3.0
[12912] 19 Oct 21:04:45.014 # Granting read/write access to 'NT AUTHORITY\NetworkService' on: "D:\chengxu\redis-3.0.504-x64" "D:\chengxu\redis-3.0.504-x64\"
[12912] 19 Oct 21:04:45.014 # Redis successfully installed as a service.
卸载服务
# 不指定服务名,使用默认服务名redis
D:\chengxu\redis-3.0.504-x64>redis-server --service-uninstall
[17268] 19 Oct 21:17:29.102 # Redis service successfully uninstalled
# 卸载前先停止服务
D:\chengxu\redis-3.0.504-x64>redis-server --service-uninstall --service-name redis3.0
[17476] 19 Oct 21:17:50.561 # Redis service successfully uninstalled.
停止服务
# 服务名称如果不指定默认为redis
D:\chengxu\redis-3.0.504-x64>redis-server --service-stop --service-name redis3.0
[12360] 19 Oct 21:23:08.044 # Redis service successfully stopped.
启动服务
# 服务名称如果不指定默认为redis。如果服务已经启动,再次执行会报错。
D:\chengxu\redis-3.0.504-x64>redis-server --service-start --service-name redis3.0
[16536] 19 Oct 21:24:08.587 # Redis service successfully started.
客户端连接
D:\chengxu\redis-3.0.504-x64>redis-cli --help
redis-cli 3.0.504
Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]
-h <hostname> Server hostname (default: 127.0.0.1).
-p <port> Server port (default: 6379).
-s <socket> Server socket (overrides hostname and port).
-a <password> Password to use when connecting to the server.
实战
D:\chengxu\redis-3.0.504-x64>redis-cli -h localhost -p 6381
localhost:6381> get foo
(nil)
localhost:6381> set foo 1
OK
localhost:6381> exit
bugs
# 没有指定配置文件,将会使用默认的配置。而且是需要密码的,但是我们并不知道密码。
D:\chengxu\redis-3.0.504-x64>redis-server
[1460] 19 Oct 20:31:59.351 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
[1460] 19 Oct 20:31:59.353 # Creating Server TCP listening socket *:6379: bind: No such file or directory
D:\chengxu\redis-3.0.504-x64>netstat -ano |findstr 6379
TCP 0.0.0.0:6379 0.0.0.0:0 LISTENING 5188
TCP [::]:6379 [::]:0 LISTENING 5188
# 打开客户端,没有认证
127.0.0.1:6379> get foo
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth redis
(error) ERR invalid password
127.0.0.1:6379>
# 先停止服务再卸载服务。不然报错。
D:\chengxu\redis-3.0.504-x64>redis-server --service-uninstall --service-name redis3.0
[14972] 19 Oct 21:18:09.837 # HandleServiceCommands: system error caught. error code=1072, message = DeleteService failed: unknown error
# 如果服务已经启动,执行启动命令将报错。
D:\chengxu\redis-3.0.504-x64>redis-server --service-start --service-name redis3.0
[7304] 19 Oct 21:24:21.685 # HandleServiceCommands: system error caught. error code=1056, message = StartService failed: unknown error
# 找到不到服务名则报错。默认为redis
D:\chengxu\redis-3.0.504-x64>redis-server --service-stop
[4412] 19 Oct 21:22:47.868 # HandleServiceCommands: system error caught. error code=1060, message = OpenService failed: unknown error
redis 在 windows 中的安装的更多相关文章
- redis在windows中的安装
之前介绍过了redis的相关知识,以及在linux平台上安装redis,为了方便学习,这里记录一下redis在windows平台上的安装步骤 1.下载redis下载地址https://github.c ...
- 下载文件时-修改文件名字 Redis在Windows中安装方法 SVN安装和使用(简单版) WinForm-SQL查询避免UI卡死 Asp.Net MVC Https设置
下载文件时-修改文件名字 1后台代码 /// <summary> /// 文件下载2 /// </summary> /// <param name="Fil ...
- Redis for Windows(C#缓存)安装和使用
Redis for Windows(C#缓存)安装和使用 前言 前段时间写过两篇简单的有关Memcached缓存的相关文章,当然了只是入门的如何使用而已.最近这两天又发现了Redis这个神奇的东西,之 ...
- Appium+Robotframework实现Android应用的自动化测试-1:Appium在Windows中的安装
让我们开始在Windows中开始安装Appium吧,Appium在OS X中的具体安装后面的文章会介绍. 另外,官网上说先要装Node.js,还要装Apache Ant和Apache Maven,Gi ...
- windows中配置安装mysql数据库
MySql 是一种免费的关系型数据库,相较于 MsSqlServer 和 Oracle 比较轻量化,安装也很简单,而且免费不需要的版权费用,个人认为一般的小项目采用还是比较合适的,当然也有部分数据量很 ...
- ElasticSearch之Windows中环境安装
ElasticSearch 说明 本章,我们主要以在 Windows 中对ElasticSearch 安装进行介绍! 1. 下载 ElasticSearch 这里我们下载的版本为7.17.4为例进行介 ...
- Redis在Windows中安装方法
首先下载Redis 下载地址:https://github.com/MSOpenTech/redis/releases Redis支持32位和64位,这个需要根据你系统平台的实际情况选择,我的是64位 ...
- NoSQL和Redis简介及Redis在Windows下的安装和使用教程
转载于:http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/103.html?1455869099 NoSQL简介 介绍redis前,我 ...
- Redis在Windows下的安装和使用
NoSQL简介 介绍redis前,我想还是先认识下NoSQL,即not only sql, 是一种非关系型的数据存储,key/value键值对存储.现有Nosql DB 产品: Redis/Mongo ...
随机推荐
- CF757F Team Rocket Rises Again
题意 建出最短路图(DAG)之后就跟这题一样了. code: #include<bits/stdc++.h> using namespace std; #define int long l ...
- springboot集成freemarker属性配置(不知道是针对于某个版本,2.0后有变动)
freemarker属性配置 freemarker属性配置: spring.freemarker.allow-request-override=false # 设置是否允许HttpServletReq ...
- k-means实战-RFM客户价值分群
数据挖掘的十大算法 基本概念 导入数据集到mysql数据库中 总共有940个独立消费数据 K-Means 算法 K-Means 算法是一个聚类算法.你可以这么理解,最终我想把物体划分成 K 类.假设每 ...
- 冒泡排序法(C语言)
冒泡排序(Bubble Sort)一种计算机科学领域的较简单的排序算法.它重复地走访过要排序的元素列,依次比较两个相邻的元素,如果顺序(如从大到小.首字母从从Z到A)错误就把他们交换过来.走访元素的工 ...
- vue.js操作元素属性
vue动态操作div的class 看代码: <!doctype html> <html lang="en"> <head> <meta c ...
- SQL 错误: ORA-65096: 公用用户名或角色名无效 65096. 00000 - "invalid common user or role name" *Cause: An attempt was made to create a common user or role with a name
在Oracle SQL Developer中,试图创建RD用户时,出现了如下的错误: 在行: 上开始执行命令时出错 - 错误报告 - SQL 错误: ORA: 公用用户名或角色名无效 . - &quo ...
- LeetCode 189:旋转数组 Rotate Array
公众号:爱写bug(ID:icodebugs) 给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数. Given an array, rotate the array to the ...
- iview 组件的额外传参问题记录
在使用iview组件的时候,经常遇到额外传参的问题,一般情况下可以使用以下2种方法都可以解决: 1.直接在方法后面输入参数,有的时候借用$event获取当前dom信息,在某些特定情况下可以将参数绑定在 ...
- Python 多进程池
def get_html(n): time.sleep(n) print("sub_progress success") return n # 多进程池 pool = multip ...
- vue数据更改视图不更新问题----深入响应式原理
Vue响应式原理之官方解释 当你把一个普通的JavaScript对象传给Vue实例的data选项,Vue将遍历此对象所有的属性,并使用Object.defineProperty把这些属性全部转为get ...