Commands for clearing data in Redis

Source: Internet
Author: User
Tags eval flush lua redis

Reprint: http://ju.outofmemory.cn/entry/330999

There are 3 commands for clearing data in Redis, namely: Flushall, Flushdb, SCRIPT FLUSH. Flushall [ASYNC]

Indicates that all data in all db is deleted. The default is a synchronous operation, and the option async means asynchronous, that is, the empty operation takes place in a new thread and does not block the main thread.

$ redis-cli-h 127.0.0.1-p 6379 Flushall ASYNC
flushdb [ASYNC]

Represents the deletion of all data in the current DB . The default is synchronous, which, like Flushall, supports option async, which represents async. To delete all data in the specified DB, you can use the Select command to first select DB and then use the FLUSHDB command to clear the data:

$ redis-cli-h 127.0.0.1-p 6379 SELECT 0
$ redis-cli-h 127.0.0.1-p 6379 flushdb
SCRIPT FLUSH

Indicates that all Lua script caches are deleted. All of the LUA scripts that have been executed are placed in the script cache, which forces the emptying of all Lua script caches. Refer to the EVAL command for more information on LUA scripting.

$ redis-cli-h 127.0.0.1-p 6379 SCRIPT FLUSH
ReferenceFlushall flushdb SCRIPT FLUSH EVAL

There are 3 commands for clearing data in Redis, namely: Flushall, Flushdb, SCRIPT FLUSH. Flushall [ASYNC]

Indicates that all data in all db is deleted. The default is a synchronous operation, and the option async means asynchronous, that is, the empty operation takes place in a new thread and does not block the main thread.

$ redis-cli-h 127.0.0.1-p 6379 Flushall ASYNC
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.