↑ ↓ select, Enter open, Esc close

Flush a single Redis database (FLUSHDB)

Adjust the values, the command updates live
user@server
redis-cli -n 0 FLUSHDB

Immediately removes all keys of the database selected with -n, without asking for confirmation. Unlike FLUSHALL, only the data of this one database number is affected. Check beforehand with redis-cli INFO keyspace which number belongs to which application.

Note: If the database holds not only cache data but also PHP sessions or queues, those are lost for good. For a single WordPress site, wp cache flush is the gentler option.

Also searched as

  • clear redis cache for one website
  • delete redis database
  • run redis flushdb

Related one-liners

All in Redis and Memcached

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.