| acl_categories |
|
|||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| arguments |
|
|||||||||||||||||||||||||||||||
| arity | -1 | |||||||||||||||||||||||||||||||
| categories |
|
|||||||||||||||||||||||||||||||
| command_flags |
|
|||||||||||||||||||||||||||||||
| complexity | O(N) where N is the total number of keys in all databases | |||||||||||||||||||||||||||||||
| description | Removes all keys from all databases. | |||||||||||||||||||||||||||||||
| group | server | |||||||||||||||||||||||||||||||
| hidden | false | |||||||||||||||||||||||||||||||
| hints |
|
|||||||||||||||||||||||||||||||
| history |
|
|||||||||||||||||||||||||||||||
| linkTitle | FLUSHALL | |||||||||||||||||||||||||||||||
| railroad_diagram | /images/railroad/flushall.svg | |||||||||||||||||||||||||||||||
| since | 1.0.0 | |||||||||||||||||||||||||||||||
| summary | Removes all keys from all databases. | |||||||||||||||||||||||||||||||
| syntax_fmt | FLUSHALL [ASYNC | SYNC] | |||||||||||||||||||||||||||||||
| title | FLUSHALL |
{{< note >}} This command is affected by cross-slot operations. See the [multi-key operations]({{< relref "/develop/using-commands/multi-key-operations" >}}) page for more information. {{< /note >}}
Delete all the keys of all the existing databases, not just the currently selected one. This command never fails.
By default, FLUSHALL will synchronously flush all the databases.
Starting with Redis 6.2, setting the lazyfree-lazy-user-flush configuration directive to "yes" changes the default flush mode to asynchronous.
It is possible to use one of the following modifiers to dictate the flushing mode explicitly:
ASYNC: flushes the databases asynchronouslySYNC: flushes the databases synchronously
{{< clients-example cmds_servermgmt flushall >}} FLUSHALL SYNC {{< /clients-example >}}
- An asynchronous
FLUSHALLcommand only deletes keys that were present at the time the command was invoked. Keys created during an asynchronous flush will be unaffected. - This command does not delete functions.
- Other than emptying all databases (similar to
FLUSHDB), this command clears the RDB persistence file, aborts any snapshot that is in progress, and, if thesaveconfig is enabled, saves an empty RDB file.
>= 6.2.0: Default flush behavior now configurable by the lazyfree-lazy-user-flush configuration directive.
| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard ❌ Active-Active* |
✅ Standard ❌ Active-Active |
*Can use the [Active-Active flush API request]({{< relref "/operate/rs/references/rest-api/requests/crdbs/flush" >}}). |
{{< multitabs id="flushall-return-info" tab1="RESP2" tab2="RESP3" >}}
Simple string reply: OK.
-tab-sep-
Simple string reply: OK.
{{< /multitabs >}}