一:redis端口6379 ,是key-vaule键值对类型数据,数据存储到内存里面,读写速度快,键必须是字符串,值有五种类型
二:Redis支持五种数据类型:string(字符串),hash(哈希),list(列表),set(集合)及zset(sorted set:有序集合)
1:字符串
redis 127.0.0.1:6379> SET runoobkey redis OK redis 127.0.0.1:6379> GET runoobkey "redis"
2:hash(哈希)--存一个对象,里面有属性和值
hset py3 name aa bb cc
127.0.0.1:6379> hgetall py3
"name"
"aa"
"bb"
"cc"
3:list(列表)
127.0.0.1:6379> lpush gg ll jj hh
(integer) 3
127.0.0.1:6379> lrange gg 0 10
"hh"
"jj"
"ll"
4:set(集合)----无序,唯一
127.0.0.1:6379> sadd py5 11 12 name li
127.0.0.1:6379> smembers py5
1)"11"
2) "li"
3) "name"
4) "12"
5:zset(sorted set:有序集合)
127.0.0.1:6379> zadd py10 1 pp (integer) 1
127.0.0.1:6379> zadd py10 2 dd (integer) 1
127.0.0.1:6379> zadd py10 3 dd (integer) 0
127.0.0.1:6379> zadd py10 5 cc (integer) 1
127.0.0.1:6379> zadd py10 4 ee (integer) 1
127.0.0.1:6379> zrange py10 0 -1
1) "pp"
2) "dd"
3) "ee"
4) "cc"
标签:127.0,0.1,py10,redis,6379,integer From: https://www.cnblogs.com/vip01/p/17094998.html