Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of emptying data in redis

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail the method of emptying the data in redis. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

The Redis Flushall command is used to empty the data for the entire Redis server (delete all key for all databases).

Grammar

The basic syntax for redis Flushall commands is as follows:

Redis 127.0.0.1 6379 > FLUSHALL

Available version

> = 1.0.0

Return value

Always return OK.

Example

The number of key in redis 127.0.0.1 key 6379 > DBSIZE # 0 database (integer) 9 redis 127.0.0.1 key 6379 > SELECT 1 # switch to database 1 OK redis 127.0.0.1 key 6379 > DBSIZE # 1 database key quantity (integer) 6 redis 127.0.1 key 6379 > flushall # clear all databases keyOK redis 127.0. Not only has database 0.1 redis 6379 > DBSIZE # been emptied (integer) 0 redis 127.0.0.1 redis 6379 > SELECT 0 # 0 (and all other databases), but also OK redis 127.0.1 OK redis 6379 > DBSIZE (integer) 0. So much for the method of emptying data in redis. I hope the above content can be of some help to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report