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 ...
随机推荐
- Python __slots__
Python 类的特殊变量:__slots__ 使用 __slots__ 后,类中 __weakref__ 和 __dict__ 消失,同时阻止动态属性绑定 由于 __dict__ 记录着类中所有的属 ...
- 43 树莓派安装pytorch
狗狗 https://www.pytorchtutorial.com/pytorch-c-api-4-cat-dog-classifier-2/ 鲜花分类器 https://www.pytorchtu ...
- c++负数下标
如何使用负数下标呢? 让数组前面有东西 int y[100]; int *z = y + 50; 这样的话调用\(z[-50]\)就变成了调用\(y[0]\) z[-50] = y[0]; 然后这样就 ...
- Linux环境变量配置方法
Linux上环境变量配置分为设置永久变量和临时变量两种.环境变量设置方法同时要考虑环境Shell类型,不同类型的SHELL设置临时变量方法和设置永久变量对应的配置文件不同.Linux环境变量本身配置过 ...
- Java 基础系列:异常
Java 中的异常(Exception)又称为例外,是一个在程序执行期间发生的事件,它中断正在执行的程序的正常指令流.为了能够及时有效地处理程序中的运行错误,必须使用异常类. 1. 异常类型 Thro ...
- 5G最新套餐以及对应限速标准
原文: http://news.mydrivers.com/1/654/654529.htm 再过两天,国内的5G就要正式运营了,中国移动.联通.电信的5G预约用户亿元超过千万,三家运营商的5G套餐费 ...
- C# 位运算基本大全
1.原码 反码 补码 只用补码进行计算,且没有减法.只有用补码进行加法运算,具体原因,详见:http://www.cnblogs.com/zhangziqiu/archive/2011/03/30/C ...
- 在Ubuntu18.04.2LTS上遇到的问题汇总
在Ubuntu18.04.2LTS上遇到的问题汇总 一.前言 在新版的Ubuntu上在桌面右键没有新建文档的按钮着实让人难以接受,其实只要稍微理解就能明白设计者的良苦用心,因为这样便于扩展性和自定 ...
- multer 基础教程(英文版)
Multer is a node.js middleware for handling multipart/form-data, which is primarily used for uploadi ...
- 【08】Nginx:安全优化 / 信息隐藏 / 请求限制 / 白名单
写在前面的话 nginx 中主要的内容在前面的章节其实已经差不多了,接下都是一些小功能的实现以及关于 nginx 的优化问题.我们一起来探讨以下,如何把我们的 nginx 打造成为企业级应用. 安全优 ...