[Windows] Redis使用记录

Redis使用记录

一.软件版本

  • Redis版本:
    • Redis-x64-3.2.100.zip
    • Redis-x64-3.2.100.msi
  • 其它

Windows版本:Windows Server 2012

Windows-Redis下载:https://github.com/MicrosoftArchive/redis/releases

  • 更多的操作说明,请查阅 Redis 目录下的 Windows Service Documentation.docx 文件

二.Redis使用记录

  • Redis-x64-3.2.100.msi 直接安装,自动配置windows服务
  • Redis-x64-3.2.100.zip 需要手动启动,或手动配置windows服务

1.安装redis

  • Redis-x64-3.2.100.zip 包,拷贝到安装目录
  • 解压

命令运行环境:

  • cmd 窗口
  • cd 到 redis 安装目录 (redis根目录)

2.配置redis.windows.conf

约定(非强制区分):

  1. redis.windows-service.conf 为注册 windows 服务的配置
  2. redis.windows.conf 为 cmd 窗口启动时的配置
  • 找到 bind 127.0.0.1 ,改为 bind 0.0.0.0 (允许其它机器访问)
  • 找到 protected-mode yes ,改为 protected-mode no (关闭保护模式)

3.启动

1)手动启动
  • 执行启动 Redis 服务端的命令
> redis-server redis.windows.conf
2)自启动

1.通过注册 windows 服务,实现自启动

  • 执行创建 Windows 服务的命令(注意指定的配置文件)
> redis-server --service-install redis.windows-service.conf --loglevel verbose
> redis-server --service-start
  • windows键 + R 输入 services.msc ,找到 Redis 名称的服务

2.安装 msi 版本的 Redis

  • 下载安装 Redis-x64-3.2.100.msi ,会自动创建 windows 服务
    • 默认配置文件 redis.windows-service.conf
    • 卸载软件,可以运行 Redis-x64-3.2.100.msi 找到 Remove 功能
3)取消自启动

通过删除 windows 服务,取消自启动

  • 执行删除 Windows 服务的命令
> redis-server --service-uninstall
4)远程连接
  • 执行 Redis 客户端的命令 - 无密码
> redis-cli -h 192.168.12.12 -p 6379
  • 执行 Redis 客户端的命令 - 有密码
> redis-cli -h 192.168.12.12 -p 6379 -a 123456
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

趴着喝可乐

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值