我可以使用 telnet 命令连接到远程 redis 并获取“mytest”键的值。以下内容按预期工作。
[root@server shantanu]# telnet 10.10.10.100 6379
Trying 10.10.10.100...
Connected to 10.10.10.100 (10.10.10.100).
Escape character is '^]'.
get mytest
$14
this is first
但是我如何在 shell 脚本中使用它呢? 我习惯使用以下方式连接到 mysql:
msyql -h10.10.10.100 -uroot -proot@123 -e"show databases"
redis 有类似的语法吗?
最佳答案
您也可以使用 redis-cli
,包含在 redis 中
$ ./src/redis-cli --raw GET key
test
关于shell - 命令提示符下远程服务器的输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8091721/