Home > Database > Redis > Use command to connect to redis

Use command to connect to redis

Release: 2020-04-13 09:12:32
forward
2878 people have browsed it

Use command to connect to redis

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
Copy after login

Remote

$ redis-cli -h host -p port -a password
Copy after login

Connect Remote

wd@wd:/usr/local/bin$ ./redis-cli -h redis.dm.com -p 6381
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template