Redis remote connections and basic commands

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/TreeShu321/article/details/102730283

Redis remote connections

command using the remote connection server redis redis-cli.

Syntax is: redis-cli -h host -p port -a password
Example: redis-cli -h 127.0.0.1 -p 6379 -a "mypass"

  • -h: ip address
  • -p: Port
  • -a: Password

Redis basic commands

  • DEL key
    command is used to delete the key in the key presence
  • DUMP key
    sequence of a given key, and return the value to be serialized.
  • EXISTS key
    to check whether a given key exists.
  • EXPIRE key seconds
    for a given setting key expiration time, in seconds.
  • EXPIREAT key timestamp
    role EXPIREAT and EXPIRE similar, are used to set the expiration time for the key. Except that the time parameter EXPIREAT accepted command is a UNIX timestamp (unix timestamp).
  • PEXPIRE key milliseconds
    set the key expiration time in milliseconds.
  • PEXPIREAT key milliseconds-timestamp
    provided key expiration time stamp (unix timestamp) in milliseconds
  • KEYS pattern
    Find all key match a given pattern (pattern) of.
  • Db the MOVE key
    will move the current database key database to a given db them.
  • PERSIST key
    remove key expiration time, key will endure.
  • PTTL key
    milliseconds return key remaining expiration time.
  • The TTL key
    in seconds, return the remaining lifetime of a given key (TTL, time to live).
  • RANDOMKEY
    returns a random key from the current database.
  • RENAME key newkey
    change the name of the key
  • RENAMENX key newkey
    only when newkey does not exist, the key renamed newkey.
  • The TYPE key
    type of return value of the stored key.

Guess you like

Origin blog.csdn.net/TreeShu321/article/details/102730283