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!