Redis安装[Windows]

时间:2023-11-14 14:54:32

一.  redis下载地址:  https://github.com/ServiceStack/redis-windows/tree/master/downloads

  根据需要的下载对应版本*.zip即可.(我这里是win7x64)

二.使用

  1.  下载之后解压到你相应的目录下:

    Redis安装[Windows]

 文件介绍:
redis-benchmark.exe #基准测试
redis-check-aof.exe # aof
redischeck-dump.exe # dump
redis-cli.exe # 客户端
redis-server.exe # 服务器
redis.windows.conf # 配置文件

  2.   简单启动redis:

      进入解压后的文件夹,shift+右键进入cmd;

    Redis安装[Windows]

    键入CMD命令: redis-server.exe redis.windows.conf

    Redis安装[Windows]

    注: 此为服务启动成功的状态,关闭服务直接关掉cmd窗口即可;

  3.  简单测试状态,在此处再打开一个cmd窗口,键入 redis-cli.exe

    Redis安装[Windows]

三.  安装redis 服务

  1.在此文件夹下再打开一个cmd窗口,运行命令 :

   redis-server --service-install redis.windows.conf --loglevel verbose

  Redis安装[Windows]

  

  2. 关闭服务端cmd窗口,刷新后在服务中启动redis服务;

    Redis安装[Windows]

  3. 启动redis-cli.exe 测试看看;

四. 其他相关

  1. 更多的redis命令,可以看官方网站或中文站,戳这里:http://www.redis.cn/commands.html

  2. Redis可视化工具,RedisDesktopManager,开源的,

   托管在github上,感兴趣的可以去看看:https://github.com/uglide/RedisDesktopManager

  3. 管理工具: RedisStudio: https://github.com/cinience/RedisStudio

  4. hosts设置:

 set duapphosts=127.0.0.1        sqld.duapp.com
set redisduapphosts=127.0.0.1 redis.duapp.com
echo %duapphosts% >> C:\Windows\System32\drivers\etc\hosts
echo %redisduapphosts% >> C:\Windows\System32\drivers\etc\hosts