Redis命令
检测Redis
redis打开redis-cli输入PING,输出PONG
命令如下:
Redis远程连接
redis-cli -h host -p port -a password
如:redis-cli -h 127.0.0.1 -p 6379 -a “mypass”
中文乱码
redis-cli --raw可以避免
Redis数据操作命令
DEL key
string: get key , set key value
hash:
1. HMSET( HMSET key field1 “value1” …)
2. HGET key field
list:
1. lpush key value
2. lrange key beginIndex endIndex
set:
1. sadd key member
2. smembers key(查看集合元素)
zset:
1. zadd key score member (根据score对member进行排序)