Redis操作日志

 

1、切换数据库

127.0.0.1:6379>
127.0.0.1:6379> select 1
OK
127.0.0.1:6379[1]>
127.0.0.1:6379[1]>
127.0.0.1:6379[1]>

 

2、查看数据库大小

127.0.0.1:6379[1]>
127.0.0.1:6379[1]>
127.0.0.1:6379[1]> dbsize
(integer) 0
127.0.0.1:6379[1]>
127.0.0.1:6379[1]>

 

3、查看所有的 key

127.0.0.1:6379[1]>
127.0.0.1:6379[1]> keys *
(empty list or set)
127.0.0.1:6379[1]>

 

4、存储数据

127.0.0.1:6379[1]>
127.0.0.1:6379[1]> set time 20220427
OK
127.0.0.1:6379[1]>
127.0.0.1:6379[1]>

 

5、查数据

127.0.0.1:6379[1]>
127.0.0.1:6379[1]> get time
"20220427"
127.0.0.1:6379[1]>
127.0.0.1:6379[1]>

 

6、再次查询所有key

127.0.0.1:6379[1]>
127.0.0.1:6379[1]> keys *
1) "time"
127.0.0.1:6379[1]>
127.0.0.1:6379[1]>

 

 

 

 

 

 

 

 

 

 

##########################