redis常用查询操作

1.登陆命令:/usr/local/redis/bin/redis-cli -h 127.0.0.1 -p 6388 -a 123456

2.切换数据库:127.0.0.1:6379[2]> select 1

2.获取所有key:127.0.0.1:6388> keys *

3.获取指定key:127.0.0.1:6388> keys frd_5

4.获取指定key的类型:127.0.0.1:6388> TYPE frd_5

5.查看key下的所有内容:127.0.0.1:6002> HGETALL rank_level_2_i

5.获取指定key的值:127.0.0.1:6388> HGET frd_5 29360136

10、增加,查询,删除数据,在此目录下:/usr/local/redis/bin

[root@iZf8zgmcqbodq6fb8j8k54Z bin]# ./redis-cli
127.0.0.1:6379> set test hello
OK
127.0.0.1:6379> get test
"hello"
127.0.0.1:6379> del test
(integer) 1
127.0.0.1:6379> get test
(nil)
127.0.0.1:6379>

11、查询所有key

127.0.0.1:6379> set test hello
OK
127.0.0.1:6379> set test1 hello1
OK
127.0.0.1:6379> set test2 hello2
OK
127.0.0.1:6379> keys *
1) "test"
2) "test1"
3) "test2"