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, 2 is the error output
Use Redis as a Linux service for random startup
Vi/etc/rc. local, add the Code:
/Root/install/redis-2.4.9/src/redis-server
Client Connection
Src/redis-cli
Stop the redis service:
Src/redis-cli shutdown
Add, delete, modify, and query:
Keys *
Retrieve all the currently matched keys
> Exists larry
(Integer) 0
Whether the current key exists
Del lv
Delete current key
Expire
Set expiration time
> Expire larry 10
(Integer) 1
> Move larry ad4
(Integer) 1
Move larry key-value pair to ad4 Database
> Persist lv
(Integer) 1
Expiration time for removing the current key
Randomkey
Returns a random key.
Rename
Rename key
Type
Data Type of the returned value
Type testlist
List
> Ping
PONG
Test whether the connection is still in progress
> Echo name
"Larry"
Print
> Select ad4databank
OK
Database Switching
> Quit
Disconnect
> Dbsize
(Integer) 12
Number of keys in the current database
> Info
Basic Server Information
Monitor
Real-time dump of received requests
Config get
Get server parameter configuration
Flushdb
Clear Current Database
Flushall
Clear all databases