Home >Database >Redis >How to clean Redis cache

How to clean Redis cache

尚
forward
2019-11-28 16:48:294624browse

How to clean Redis cache

Redis cache cleaning method: (Recommended: redis video tutorial)

Windows cleaning method:

Step 1: cd D:\Program Files\Redis (enter the redis installation directory), double-click to run redis-cli.exe

How to clean Redis cache

Step 2: Execute flushall and flushdb

How to clean Redis cache

Linux cleaning method:

1. Access the redis root directory cd /usr/local/redis-2.8.19

2. Enter src/redis-cli cd src/redis-cli

3. Execute: dbsize

4. Execute: flushall

5. Execute :exit

The redis cluster specified key is worth cache cleaning:

1) Log in to the redis server of the specified port

redis-cli -h 127.0.0.1 -p 6379

Among them, 127.0.0.1 can be written as the IP address of the server, 6379 is the port number.

2) View all key values ​​

keys *

3) Delete the value of the specified index

del key

For more redis knowledge, please pay attention to the redis introductory tutorial column.

The above is the detailed content of How to clean Redis cache. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete