Let MySQL have direct write redis capability

Source: Internet
Author: User

1. File Package Download

Http://pan.baidu.com/s/1qW9DHYc

2. Installation

- - - I/usr/local/mysql/---/usr /local/MySQL/lib/plugin/

3. Generating functions

DROP FUNCTION IF EXISTS' Redis_connect ';DROP FUNCTION IF EXISTS' Redis_close ';DROP FUNCTION IF EXISTS' redis_put ';DROP FUNCTION IF EXISTS' Redis_set ';DROP FUNCTION IF EXISTS' Redis_delete ';DROP FUNCTION IF EXISTS' Redis_incrby ';DROP FUNCTION IF EXISTS' REDIS_INCR ';DROP FUNCTION IF EXISTS' Redis_decrby ';DROP FUNCTION IF EXISTS' REDIS_DECR ';DROP FUNCTION IF EXISTS' REDIS_DECR ';DROP FUNCTION IF EXISTS' Redis_lpush ';DROP FUNCTION IF EXISTS' Redis_rpush ';DROP FUNCTION IF EXISTS' redis_pipe ';DROP FUNCTION IF EXISTS' Json_object ';Create functionJson_objectreturnsString soname'udf_redis.so';Create functionRedis_pipereturnsString soname'udf_redis.so';Create functionRedis_rpushreturnsString soname'udf_redis.so';Create functionRedis_lpushreturnsString soname'udf_redis.so';Create functionRedis_decrreturnsString soname'udf_redis.so';Create functionRedis_decrbyreturnsString soname'udf_redis.so';Create functionRedis_incrreturnsString soname'udf_redis.so';Create functionRedis_incrbyreturnsString soname'udf_redis.so';Create functionRedis_deletereturnsString soname'udf_redis.so';Create functionRedis_setreturnsString soname'udf_redis.so';Create functionRedis_closereturnsString soname'udf_redis.so';Create functionRedis_connectreturnsString soname'udf_redis.so';

4, use (simple small example)

Select redis_set ('myKey3','myValues3')
SelectRedis_pipe (CONCAT ('Set MyKey1',' ','myValues1','\ r \ n','Set MyKey2',' ','MyValues2','\ r \ n'))

Note: This execution will have to return, do not want to have a return as modified as follows

SET @str_res = (select Redis_set (' MyKey3 ', ' MyValues3 '))

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.