Redis Common Commands

Source: Internet
Author: User
Tags echo name

start Redis service src/redis-server or Src/redis-server redis.conf

Src/redis-server redis.conf 1>log.log 2>errlog.log

1 is the standard output and 2 is the error output

randomly start vi/etc/rc.local with Redis as a Linux service , adding code:

/root/install/redis-2.4.9/src/redis-server

Client Connection SRC/REDIS-CLI
Stop Redis service: src/redis-cli shutdown

Additions and deletions to check:

keys * Remove all keys that are currently matched

> exists Larry (integer) 0

Whether the current key exists

del lv Delete current key

expire Setting the expiration time

> Expire Larry (Integer) 1

> Move Larry Ad4 (integer) 1

Move Larry Key value pair to AD4 database

> Persist LV (integer) 1 Remove the expiration time of the current key

Randomkey

Randomly returns a key

Rename Rename key

Type the data type of the return value

Type Testlist List

> ping PONG
Test whether the connection is still

>echo Name

"Larry"

Print

> Select Ad4databank OK Database switchover

> quit the connection

> Dbsize (integer) 12

Number of keys in the current database

> Info Server basic information

Monitor

Real-time dumping of received requests

config get gets the parameter configuration of the server

flushdb emptying the current database

flushall clearing all databases

Redis Common Commands

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.