Home > Database > Redis > body text

How to clean Redis cache

Release: 2019-11-28 16:48:29
forward
4541 people have browsed it

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
Copy after login

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 *
Copy after login

3) Delete the value of the specified index

del key
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!