语法:redis-cli -h 192.168.20.33 -p 6379

如果是连接本机,并且采用默认的端口,可以直接用redis-cli

# pwd
/root/test/redis-5.0.12/src
# ./redis-cli
127.0.0.1:6379>        //已经进入控制台

可以输入一些简单的命令进行测试:

set foo 100
incr foo
append foo xxx
get foo

详细解释:

用法:redis-cli [OPTIONS] [cmd [arg [arg ...]]]
-h <主机ip>,默认是127.0.0.1
-p <端口>,默认是6379
-a <密码>,如果redis加锁,需要传递密码
--help,显示帮助信息

想知道更多参数和用法,可以用help命令,help前面添加2个短横线:

[root@localhost redis-5.0.12]# src/redis-cli --help
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.You can also use the REDISCLI_AUTH environmentvariable to pass this password more safely(if both are used, this argument takes predecence).-u <uri>           Server URI.-r <repeat>        Execute specified command N times.-i <interval>      When -r is used, waits <interval> seconds per command.It is possible to specify sub-second times like -i 0.1.-n <db>            Database number.-x                 Read last argument from STDIN.-d <delimiter>     Multi-bulk delimiter in for raw formatting (default: \n).-c                 Enable cluster mode (follow -ASK and -MOVED redirections).--raw              Use raw formatting for replies (default when STDOUT isnot a tty).--no-raw           Force formatted output even when STDOUT is not a tty.--csv              Output in CSV format.--stat             Print rolling stats about server: mem, clients, ...--latency          Enter a special mode continuously sampling latency.If you use this mode in an interactive session it runsforever displaying real-time stats. Otherwise if --raw or--csv is specified, or if you redirect the output to a nonTTY, it samples the latency for 1 second (you can use-i to change the interval), then produces a single outputand exits.--latency-history  Like --latency but tracking latency changes over time.Default time interval is 15 sec. Change it using -i.--latency-dist     Shows latency as a spectrum, requires xterm 256 colors.Default time interval is 1 sec. Change it using -i.--lru-test <keys>  Simulate a cache workload with an 80-20 distribution.--replica          Simulate a replica showing commands received from the master.--rdb <filename>   Transfer an RDB dump from remote server to local file.--pipe             Transfer raw Redis protocol from stdin to server.--pipe-timeout <n> In --pipe mode, abort with error if after sending all data.no reply is received within <n> seconds.Default timeout: 30. Use 0 to wait forever.--bigkeys          Sample Redis keys looking for keys with many elements (complexity).--memkeys          Sample Redis keys looking for keys consuming a lot of memory.--memkeys-samples <n> Sample Redis keys looking for keys consuming a lot of memory.And define number of key elements to sample--hotkeys          Sample Redis keys looking for hot keys.only works when maxmemory-policy is *lfu.--scan             List all keys using the SCAN command.--pattern <pat>    Useful with --scan to specify a SCAN pattern.--intrinsic-latency <sec> Run a test to measure intrinsic system latency.The test will run for the specified amount of seconds.--eval <file>      Send an EVAL command using the Lua script at <file>.--ldb              Used with --eval enable the Redis Lua debugger.--ldb-sync-mode    Like --ldb but uses the synchronous Lua debugger, inthis mode the server is blocked and script changes arenot rolled back from the server memory.--cluster <command> [args...] [opts...]Cluster Manager command and arguments (see below).--verbose          Verbose mode.--no-auth-warning  Don't show warning message when using password on commandline interface.--help             Output this help and exit.--version          Output version and exit.Cluster Manager Commands:Use --cluster help to list all available cluster manager commands.    '提示进一步查看--cluster的帮助信息'Examples:cat /etc/passwd | redis-cli -x set mypasswdredis-cli get mypasswdredis-cli -r 100 lpush mylist xredis-cli -r 100 -i 1 info | grep used_memory_human:redis-cli --eval myscript.lua key1 key2 , arg1 arg2 arg3redis-cli --scan --pattern '*:12345*'

进一步查看--cluster集群配置的帮助信息,这时省略help前面的2个短横线即可:

[root@localhost redis-5.0.12]# src/redis-cli --cluster help
Cluster Manager Commands:create         host1:port1 ... hostN:portN--cluster-replicas <arg>check          host:port--cluster-search-multiple-ownersinfo           host:portfix            host:port--cluster-search-multiple-ownersreshard        host:port--cluster-from <arg>--cluster-to <arg>--cluster-slots <arg>--cluster-yes--cluster-timeout <arg>--cluster-pipeline <arg>--cluster-replacerebalance      host:port--cluster-weight <node1=w1...nodeN=wN>--cluster-use-empty-masters--cluster-timeout <arg>--cluster-simulate--cluster-pipeline <arg>--cluster-threshold <arg>--cluster-replaceadd-node       new_host:new_port existing_host:existing_port--cluster-slave--cluster-master-id <arg>del-node       host:port node_idcall           host:port command arg arg .. argset-timeout    host:port millisecondsimport         host:port--cluster-from <arg>--cluster-copy--cluster-replacehelp

参考:
《redis-cli,Redis命令行工具》

【Redis】client客户端 工具 redis-cli相关推荐

  1. Redis Client UI工具

    前言 使用Redis做缓存也有一段时间了,一款趁手的UI工具可以省下很多的开发时间.这里,便总结下我所使用的Redis UI 工具. Redis Client 原生工具 Redis Client (g ...

  2. Redis Desktop Manager – Redis可视化管理工具、redis图形化管理工具、redis可视化客户端、redis集群管理

    Redis Desktop Manager – 个人认为是目前最好用的Redis可视化管理工具. redis可视化工具.Redis可视化管理工具.redis图形化管理工具.redis可视化客户端.re ...

  3. Redis Desktop Manager – Redis可视化管理工具、redis图形化管理工具、redis可视化客户端、redis集群管理工具

    Redis Desktop Manager – 个人认为是目前最好用的Redis可视化管理工具. redis可视化工具.Redis可视化管理工具.redis图形化管理工具.redis可视化客户端.re ...

  4. Redis 基础 -- Redis可视化客户端(Redis Desktop Manager)

    文章目录 1. Redis可视化客户端(Redis Desktop Manager) 1.1 下载Redis Desktop Manager 1.2 安装 Redis Desktop Manager ...

  5. Squirrel SQL Client客户端工具

    Squirrel SQL Client客户端工具 SQuirrel SQL Client是一个用Java编写的开源数据库工具,可以用来查看/编辑数据库的内容.发出SQL 命令.它可以支持兼容JDBC的 ...

  6. 开源Redis可视化客户端工具,用过的人都说好看又好用!

    自从Redis面世以来,作为一个开源的高性能的key-value型数据库,很大程度的对关系型数据库起到很好的补充作用. Redis实现简单,功能齐全,已经成为了业界最常用的组件之一.为了更方便的使用, ...

  7. redis 可视化工具_自荐一个有情怀的跨平台Redis可视化客户端工具——RedisViewer...

    介绍 在以往的文章中曾经介绍过几款Redis的可视化工具,在笔者的印象中,Redis至今没有一款非常专业的可视化管理客户端,就算之前介绍过的几款也是差强人意,有些时候满足不了我们的需求,而今天本文要介 ...

  8. java实现redis客户端_windows下java swt实现操作redis的客户端工具

    redisclient 1.0 正式发布,适用于多个 Redis 版本,主要更新内容如下: 1.管理 Redis 服务器 2.管理 Redis data favorite 3.管理 Redis 数据 ...

  9. 颜值爆表!Redis 官方客户端工具,功能强大,且支持可视化监控!

    点击上方"Java精选",选择"设为星标" 别问别人为什么,多问自己凭什么! 下方有惊喜留言必回,有问必答! 每一天进步一点点,是成功的开始... 一.Redi ...

  10. redis php 性能测试工具,redis性能测试与客户端连接详解

    Redis 性能测试(推荐:redis入门教程) 语法redis-benchmark [option] [option value] 实例 实例一 以下实例同时执行 1000 个请求来检测性能:$ r ...

最新文章

  1. Java设计模式-回调函数和观察者模式
  2. python3 字符串、十六进制字符串、数字、字节之间的转换
  3. springcloud config 分布式配置中心
  4. 算法训练 字符串的展开c语言
  5. 程序员都怎么过端午节?
  6. 【恋上数据结构】冒泡排序、选择排序、堆排序
  7. 二叉树的右视图 python_【leetcode刷题】T128-二叉树的右视图
  8. 安卓移动办公软件_安卓免费办公软件套装 速度快功能强大 WPS Office 12.6.4 解锁高级版特权...
  9. python工具箱系列(三)
  10. 加域时提示指定的网络名不再可用
  11. exls表格搜索快捷键_excel表格查找数据查找出来的-如何在一份Excel表格中进行快速查找,快捷键是?...
  12. 几张思维导图告诉你搜索引擎优化(SEO)核心点
  13. Android摇一摇领红包
  14. 机器学习实战读书笔记-朴素贝叶斯
  15. 超详细的程序员未来职业发展路线
  16. Android Light
  17. 开源护眼工具LightBulb2.3.3汉化说明
  18. 百亿级企业级 RPC 框架开源了!
  19. win10,win11 下部署Vicuna-7B,Vicuna-13B模型,gpu cpu运行
  20. 电脑文件误删除如何恢复?可以快速找回

热门文章

  1. “千脑智能理论”或颠覆AI,比尔·盖茨重磅推荐
  2. 怎么用python黑别人电脑_超级黑科技代码!用Python打造电脑人脸屏幕解锁神器附带接头暗号!...
  3. MSN QQ网页聊天代码
  4. 计算机一级考试题产品销售情况表,Excel案例(十二)——销售统计表
  5. C#/winform 旅游管理信息系统
  6. JavaWeb房屋租赁管理系统(servlet+jsp+mysql)
  7. 微商分销代理新零售商城源码
  8. html5视频页面的源码,html5 网页录制视频示例源码
  9. Java版本新零售小程序saas商城全开源系统
  10. pin码计算器网页版_PIN码计算锦集