How do I delete everything in Redis?

前端 未结 22 1063
无人共我
无人共我 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:48

    Your questions seems to be about deleting entire keys in a database. In this case you should try:

    1. Connect to redis. You can use the command redis-cli (if running on port 6379), else you will have to specify the port number also.
    2. Select your database (command select {Index})
    3. Execute the command flushdb

    If you want to flush keys in all databases, then you should try flushall.

提交回复
热议问题