2014-02-27 16:00:05 +00:00
|
|
|
# redis-cli
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Opens a connection to a Redis server.
|
2019-05-23 11:56:50 +01:00
|
|
|
> More information: <https://redis.io/topics/rediscli>.
|
2014-02-27 16:00:05 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Connect to the local server:
|
2014-02-27 16:00:05 +00:00
|
|
|
|
|
|
|
`redis-cli`
|
|
|
|
|
2016-01-20 11:39:49 +00:00
|
|
|
- Connect to a remote server on the default port (6379):
|
2014-02-27 16:00:05 +00:00
|
|
|
|
|
|
|
`redis-cli -h {{host}}`
|
2016-01-20 11:39:49 +00:00
|
|
|
|
|
|
|
- Connect to a remote server specifying a port number:
|
|
|
|
|
2014-02-27 16:00:05 +00:00
|
|
|
`redis-cli -h {{host}} -p {{port}}`
|
|
|
|
|
2020-11-04 14:39:54 +00:00
|
|
|
- Connect to a remote server specifying an URI:
|
|
|
|
|
|
|
|
`redis-cli -u {{uri}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Specify a password:
|
2014-02-27 16:00:05 +00:00
|
|
|
|
2014-02-27 16:01:23 +00:00
|
|
|
`redis-cli -a {{password}}`
|
|
|
|
|
2016-01-16 14:12:05 +00:00
|
|
|
- Execute Redis command:
|
2014-02-27 16:01:23 +00:00
|
|
|
|
2016-07-22 21:24:06 +01:00
|
|
|
`redis-cli {{redis_command}}`
|
2020-12-12 03:13:57 +00:00
|
|
|
|
|
|
|
- Connect to the local cluster:
|
|
|
|
|
|
|
|
`redis-cli -c`
|