📅  最后修改于: 2020-12-02 01:10:07             🧑  作者: Mango
Redis连接命令用于控制和管理与Redis Server的客户端连接。
以下示例说明了客户端如何向Redis服务器进行身份验证并检查服务器是否正在运行。
redis 127.0.0.1:6379> AUTH "password"
(error) ERR Client sent AUTH, but no password is set
redis 127.0.0.1:6379>
redis 127.0.0.1:6379> PING
PONG
redis 127.0.0.1:6379>
注意:在这里您可以看到未设置“密码”,因此您可以直接访问任何命令。
以下是Redis数据库中使用的一些基本连接命令的列表:
Index | Commands | Description |
---|---|---|
1 | AUTH password | It is used to authenticate to the server with the given password. |
2 | ECHO message | It is used to print the given string. |
3 | PING | It is used to check whether the server is running or not. |
4 | QUIT | It is used to close the current connection. |
5 | SELECT index | It is used to change the selected database for the current connection |