Redis service startup shutdown and other command practices

Source: Internet
Author: User
Tags echo name redis
Start Redis Service
Redis-server or Redis-server redis.conf

Redis-server redis.conf 1>log.log 2>errlog.log

1 for standard output, 2 for error output randomly booting Redis as a Linux service
Vim/etc/rc.local, add code:

/root/install/redis-2.8.4/src/redis-server

Client Connection:redis-cli start Client

set up Redis permissions authentication
Config set Requirepass Mamaji2015
Auth "Mamaji2015"
Stop Redis Service:pkill redis-server or redis-cli shutdown


remove all keys that are currently matched--keys *

does the current key exist--exists Larry

Delete Current key--del LV

set expiration Time--expire Larry

move Larry Key value pair to AD4 database--Move Larry Ad4

Remove Current key expiration time--persist LV

randomly returns a key--Randomkey

Rename key--Rename

the data type of the return value--type
Example: Type Testlist

Back to: List

Test If the connection is still in--ping

Print--echo name

"Larry"

Database Switchover--select Ad4databank
return: OK

quit Connection--quit

number of keys in the current database--dbsize
(integer) 12

Server Basic Information--Info

real-time dump of received requests-monitor

get the parameter configuration of the server--config get

empty Current Database--Flushdb

Clear All databases--Flushall

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.