content/commands/flushdb.md
{{< note >}} This command's behavior varies in clustered Redis environments. See the [multi-key operations]({{< relref "/develop/using-commands/multi-key-operations" >}}) page for more information. {{< /note >}}
Delete all the keys of the currently selected DB. This command never fails.
By default, FLUSHDB will synchronously flush all keys from the database.
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 database asynchronouslySYNC: flushes the database synchronouslyFLUSHDB command only deletes keys that were present at the time the command was invoked. Keys created during an asynchronous flush will be unaffected.FLUSHALL since a Redis Cluster supports only one database with an ID of zero.>= 6.2.0: Default flush behavior now configurable by the lazyfree-lazy-user-flush configuration directive.| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Not supported"><nobr>❌ Active-Active*</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | *Can use the [Active-Active flush API request]({{< relref "/operate/rs/references/rest-api/requests/crdbs/flush" >}}). |
{{< multitabs id="flushdb-return-info" tab1="RESP2" tab2="RESP3" >}}
Simple string reply: OK.
-tab-sep-
Simple string reply: OK.
{{< /multitabs >}}