Get start with "redis"
How to install a bunch of redis tutorial ~ I will not repeat it, just leave my own experience in starting redis (LZ database has no experience, so... everything starts learning redis from scratch)
When redis-server is triggered in shell, redis is started.
I was dumb at first ~ So depressed, there is no interaction. How can I use redis?
Answer: Client
After starting the redis service, you can use redis-CLI to test the client!
Open another terminal.
Demo: How to Use set get for simple operations
Disable redis Service
Run
redis-cli -p 6379 shutdown
You can close redis deamon. At this time, you can see that there is an output message in the other terminal, prompting redis to close.
Install the redis client-hiredis
Hiredis installation steps:
Get the latest hiredis in https://github.com/redis/hiredis
Decompress and
Make.
Copy a dynamic library
Mkdir/usr/lib/hiredis
CP libhiredis. So/usr/lib/libhiredis. so.0.11 # Link libhiredis. So to/usr/lib/libhiredis. so.0.11
The reason is that the dynamic library is not correctly copied. here we need to rename libhiredis. So to libhiredis. so.0.11.
Mkdir/usr/include/hiredis
CP hiredis. h/usr/include/hiredis
Compile example. c
Test
Get start with "redis" -- by "EOF"