Help Center/ Distributed Cache Service/ FAQs/ Redis Commands/ How Do I Clear Redis Data?
Updated on 2023-09-28 GMT+08:00

How Do I Clear Redis Data?

Exercise caution when clearing data.

  • Redis 4.0 or later

    To clear data of a DCS Redis 4.0 or later instance, you can run the FLUSHDB or FLUSHALL command in redis-cli, use the data clearing function on the DCS console, or run the FLUSHDB command on Web CLI.

    To clear data of a Redis Cluster instance, run the FLUSHDB or FLUSHALL command on every shard of the instance. Otherwise, data may not be completely cleared.

    • When you run the FLUSHDB command on Web CLI, only one shard is cleared at a time. If there are multiple shards, connect to the master node of each shard and run the FLUSHDB command separately.
    • Redis Cluster data cannot be cleared by using Web CLI.