The FLUSHALL command provides a fast way to remove all data from a database.

To use it, connect your database and then issue the command.

There are several ways to do this, depending on your circumstances and environment.


When you flush a database, you remove all data. This is a prerequisite to deleting a database.

This permanently removes all data from the database. The data cannot be recovered, except by restoring from earlier backups.

We strongly recommend backing up databases before flushing them.

The Redis-CLI utility

To use the redis-cli utility:

redis-cli -h <hostname> -p <portnumber> -a <password> flushall


redis-cli -h -p 12345 -a xyz flushall

The netcat utility

If you have shell access to the server hosting your database, you can use the netcat (nc) to send the flush_all command to your database:

echo "flush_all" | nc 12345

RedisInsight CLI

If you’ve installed RedisInsight and added your database, you can use the RedisInsight command-line interface (CLI) to issue commands:

  1. Start RedisInsight and connect to your database.

  2. From the RedisInsight menu, select CLI and wait for the client to connect to your database.

  3. In the command area, enter flushall and then press Enter.

    You can use RedisInsight to issue commands to a database.

    The ‘OK’ response indicates that the command executed properly.

SASL connection

If you do not have permission to access the command shell of the server hosting your database or are unable to use RedisInsight, but you have connection credentials and your database supports Simple Authentication and Security Layer connections, you can use an SASL-enabled command-line client.

For example, suppose you’re using Memcached Enterprise Cloud and that your database has SASL enabled. In this case, you can can use the bmemcached-CLI client to connect and issue commands to your database.

Setup instructions vary according to the environment. Many Linux systems, such as Ubuntu, follow this process:

$ wget
$ sudo apt-get install unzip python-pip
$ unzip -d bmemcached-cli
$ cd bmemcached-cli/bmemcached-cli-master/
$ sudo pip install --upgrade pip
$ sudo pip install . -r requirements.pip

Adjust as needed for your operating system and configuration.

When the client is properly installed, you can use it to run the flush_all command:

bmemcached-cli [user]:[password]@[host]:[port]

Here’s an example:

$ bmemcached-cli
([B]memcached) flush_all