Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I delete everything in Redis?

Tags:

redis

I want to delete all keys. I want everything wiped out and give me a blank database.

Is there a way to do this in Redis client?

like image 754
TIMEX Avatar asked Jul 27 '11 22:07

TIMEX


People also ask

How do I delete a set in Redis?

To delete a large set in Redis: Rename the key to a unique, namespaced key so that the set appears “deleted” to other Redis clients immediately. Incrementally delete members from the set in small batches until it is empty.

How do I delete a database in Redis?

open your Redis cli and There two possible option that you could use: FLUSHDB - Delete all the keys of the currently selected DB. FLUSHALL - Delete all the keys of all the existing databases, not just the currently selected one.

Does Redis keep everything memory?

All Redis data resides in memory, which enables low latency and high throughput data access. Unlike traditional databases, In-memory data stores don't require a trip to disk, reducing engine latency to microseconds.

How do I clean my Redis server?

The easiest way to clear Redis cache is to use the redis-cli command. Databases in Redis are stored individually. Using the redis-cli command allows you to either clear the keys from all databases, or from a single specified database only.


1 Answers

With redis-cli:

  • FLUSHDB – Deletes all keys from the connection's current database.
  • FLUSHALL – Deletes all keys from all databases.

For example, in your shell:

redis-cli flushall 
like image 187
Javier Avatar answered Sep 19 '22 21:09

Javier