Redis comando flushall
Redis comando flushall se utiliza para borrar todo el servidor de datos Redis (todos Borra todos los datos de claves).
gramática
Redis flushall sintaxis del comando básico es el siguiente:
redis 127.0.0.1:6379> FLUSHALL
versiones disponibles
> = 1.0.0
Valor de retorno
Siempre devuelve OK.
Ejemplos
redis 127.0.0.1:6379> DBSIZE # 0 号数据库的 key 数量 (integer) 9 redis 127.0.0.1:6379> SELECT 1 # 切换到 1 号数据库 OK redis 127.0.0.1:6379> DBSIZE # 1 号数据库的 key 数量 (integer) 6 redis 127.0.0.1:6379> flushall # 清空所有数据库的所有 key OK redis 127.0.0.1:6379> DBSIZE # 不但 1 号数据库被清空了 (integer) 0 redis 127.0.0.1:6379> SELECT 0 # 0 号数据库(以及其他所有数据库)也一样 OK redis 127.0.0.1:6379> DBSIZE (integer) 0