The data types of redis include: string (string), hash (Map), list (list), collection (sets) and ordered sets (sorted sets) and other data types .
Redis and other key-value cache products have three characteristics:
1. Redis supports persistence and can keep data in memory on disk. It can be loaded again for use when restarting.
2. Redis not only supports simple key-value type data, but also supports the storage of data structures such as list, set, zset, and hash.
3. Redis supports data backup, that is, data backup in master-slave mode.
Installation under Redis Window
Download the installation package, download address: https://github.com/MSOpenTech/redis/releases.
Redis supports 32-bit and 64-bit. You need to choose the version that suits you based on the actual situation of your system.
Download the Redis-x64-xxx.zip compressed package to the C drive. After unzipping, rename the folder to redis.
After personal testing, the download cannot be used with other drive letters. It is recommended that the unzipped package be placed on the C drive.
Open a cmd window and use the cd command to switch the directory to C: edis and run redis-server.exe redis.windows.conf
<img src="https://img.php.cn/upload/image/555/200/139/1591692705817136.png" title="1591692705817136.png" alt="Redis installation and deployment">
Open the second cmd window and do not close the original window. Otherwise, the server will not be accessible.
Switch to the redis directory and run redis-cli.exe -h 127.0.0.1 -p 6379
Set the key-value pair set lgt 123
Get the key-value pair get lgt
Related recommendations: Redis Tutorial
The above is the detailed content of Redis installation and deployment. For more information, please follow other related articles on the PHP Chinese website!