Get start with "redis" -- by "EOF"

Source: Internet
Author: User
Tags redis tutorial
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"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.