Home  >  Article  >  Database  >  How to clear cache in redis

How to clear cache in redis

步履不停
步履不停Original
2019-06-24 11:55:322026browse

How to clear cache in redis

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 specified key in the redis cluster 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 It can be written as the IP address of the server, and 6379 is the port number.
2) View all key values ​​
keys *
3) Delete the value of the specified index
del key

For more Redis related technical articles, please visit Redis Tutorial column to learn!

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

Statement:
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