码迷,mamicode.com
首页 > 数据库 > 详细

CentOS6.4安装mysql2redis

时间:2014-10-10 13:21:34      阅读:292      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   os   ar   sp   div   on   

1、安装apr

下载:http://apache.dataguru.cn//apr/apr-1.5.1.tar.gz

tar zxvf apr-1.5.1.tar.gz
cd apr-1.5.1
vi configure 找到$RM “$cfgfile”这行删掉
./configure –prefix=/usr/local/apr
make
make install

2、安装apr-util

下载:http://mirror.bit.edu.cn/apache//apr/apr-util-1.5.4.tar.gz

tar zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
.configure –with-apr=/usr/local/apr
make
make install

3、安装hiredis

下载:https://github.com/redis/hiredis/archive/master.zip

解压后上传到服务器

cd hiredis-master
make
mkdir /usr/lib/hiredis
cp libhiredis.so /usr/lib/hiredis
cp libhiredis.so /usr/lib/
cp libhiredis.so /usr/lib64/
mkdir /usr/include/hiredis
cp hiredis.h /usr/include/hiredis

4、安装lib_mysqludf_json

下载:https://github.com/mysqludf/lib_mysqludf_json/archive/master.zip

压后上传到服务器

cd lib_mysqludf_json-master
rm lib_mysqludf_json.so
gcc $(mysql_config --cflags) -shared -fPIC -o lib_mysqludf_json.so lib_mysqludf_json.c
cp lib_mysqludf_json.so /usr/local/mysql/lib/plugin/

5、安装mysql2redis

下载:https://github.com/dawnbreaks/mysql2redis/archive/master.zip

压后上传到服务器

cd mysql2redis-master
vi Makefile (替换如下代码)
PLUGINDIR = "/usr/local/mysql/lib/plugin"
INCLUDE=`/usr/local/mysql/bin/mysql_config --include` -I/usr/local/include  -I/usr/local/apr/include -I./
LIBS=-lhiredis -L$(PLUGINDIR)  -L/usr/local/apr/lib  -lapr-1  -laprutil-1

compile:
        gcc -Werror -O2 -g $(INCLUDE)  -I. -fPIC -shared -rdynamic lib_mysqludf_redis.c  $(LIBS) -o lib_mysqludf_redis_v2.so

install:
        gcc -Werror -O2 -g $(INCLUDE)  -I. -fPIC -shared -rdynamic lib_mysqludf_redis.c                 $(LIBS) -o ${PLUGINDIR}/lib_mysqludf_redis_v2.so

uninstall:
        rm -f $(PLUGINDIR)/lib_mysqludf_redis_v2.so

clean:
        rm -f *~
        rm -f *.so
        rm -f *.out
退出保存
make
cp lib_mysqludf_redis_v2.so /usr/local/mysql/lib/plugin/

 

CentOS6.4安装mysql2redis

标签:style   blog   http   color   os   ar   sp   div   on   

原文地址:http://www.cnblogs.com/kgdxpr/p/4015394.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!