How do I delete everything in Redis?

前端 未结 22 1059
无人共我
无人共我 2020-11-28 17:18

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?

22条回答
  •  青春惊慌失措
    2020-11-28 17:30

    FLUSHALL Deletes all the Keys of All exisiting databases . FOr Redis version > 4.0 , FLUSHALL ASYNC is supported which runs in a background thread wjthout blocking the server https://redis.io/commands/flushall

    FLUSHDB - Deletes all the keys in the selected Database . https://redis.io/commands/flushdb

    The time complexity to perform the operations will be O(N) where N being the number of keys in the database.

    The Response from the redis will be a simple string "OK"

提交回复
热议问题