How do I delete everything in Redis?

2019-01-09 20:35发布

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?

标签: redis
20条回答
相关推荐>>
2楼-- · 2019-01-09 21:05

i think sometimes stop the redis-server and delete rdb,aof files。 make sure there’s no data can be reloading. then start the redis-server,now it's new and empty.

查看更多
我命由我不由天
3楼-- · 2019-01-09 21:05

Open redis-cli and type:

FLUSHALL
查看更多
我命由我不由天
4楼-- · 2019-01-09 21:06

Use FLUSHALL ASYNC if using (Redis 4.0.0 or greater) else FLUSHALL

https://redis.io/commands/flushall

查看更多
何必那么认真
5楼-- · 2019-01-09 21:08
  1. Stop Redis instance.
  2. Delete RDB file.
  3. Start Redis instance.
查看更多
我欲成王,谁敢阻挡
6楼-- · 2019-01-09 21:10

If you're using the redis-rb gem then you can simply call:

your_redis_client.flushdb
查看更多
等我变得足够好
7楼-- · 2019-01-09 21:13

You can use FLUSHALL which will delete all keys from your every database. Where as FLUSHDB will delete all keys from our current database.

查看更多
登录 后发表回答