我可以使用telnet命令连接到远程redis并获取“mytest”键的值。以下按预期工作。在命令提示符处输出远程服务器
[[email protected] 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 [email protected] -e"show databases"
可用于Redis的一个simialar语法?
感谢 “--raw” 一角。但我需要连接到远程服务器。上述命令将我连接到本地服务器。对? – shantanuo
您可以使用-h覆盖该选项-p –
seppo0010