1.Access the redis root directory cd /usr/local/redis-2.8.19
2.Log in to redis:redis-cli -h 127.0.0.1 -p 6379
3.View all key values:keys *
4.Delete the value of the specified index :del key
5.Clear the entire Redis server data:flushall
6.Clear all keys in the current library: flushdb
REmote DIctionary Server (Redis) is a key-value storage system written by Salvatore Sanfilippo.
Redis is an open source log-type Key-Value database written in ANSI C language, abides by the BSD protocol, supports the network, can be memory-based and persistent, and provides APIs in multiple languages.
It is often called a data structure server because values can be strings, hashes, lists, sets and sorted sets ) and other types.
For more Redis-related technical articles, please visit the Redis Tutorial column to learn!
The above is the detailed content of How to clear redis cache. For more information, please follow other related articles on the PHP Chinese website!