Redis commands are used to perform operations on the redis service.
To execute commands on the redis service, a redis client is required. The Redis client is in the redis installation package we downloaded before.
Syntax
The basic syntax of the Redis client is:
Start the redis client, open the terminal and enter the command redis-cli. This command will connect to the local redis service.
$redis-cli redis 127.0.0.1:6379> redis 127.0.0.1:6379> PING PONG
Remote
$ redis-cli -h host -p port -a password
Connect Remote
wd@wd:/usr/local/bin$ ./redis-cli -h redis.dm.com -p 6381
For more redis knowledge, please pay attention to the redis Getting Started Tutorial column.
The above is the detailed content of Use command to connect to redis. For more information, please follow other related articles on the PHP Chinese website!