memcached udf的安装,编译安装时出现各种报错,主要是各版本的不兼容引起的。
最后成功安装,以下是安装好的各种版本,按照安装顺序如下
mysql-5.5.21.tar.gz
libevent-2.0.17-stable.tar.gz
memcached-1.4.13.tar.gz
libmemcached-0.34.tar.gz
memcached_functions_mysql-1.1?
mysql安装见?http://asyty.iteye.com/blog/1442503
?
安装memcached必须先安装libevent
?
安装libevent
?
tar -zvxf libevent-2.0.17-stable.tar.gz?
?
cd libevent-2.0.17-stable
?
./configure --prefix=/usr
?
make && make install
?
查看是否安装成功 ls /usr/lib | grep libevent
?
安装memcached
tar -zxvf memcached-1.4.13.tar.gz?
cd?memcached-1.4.13
./configure --prefix=/usr/local/ --with-libevent=/usr
?
make &&?make install
?
查看是否安装成功?ls /usr/local/bin/ | grep memcached
?
尝试启动memcached
/usr/local/bin/memcached -d -m 10 -u root -l 127.0.0.1 -p 20000 -c 256 -P tmp/memcached.pid
?
telnet连接20000端口,查看memcached 状态
telnet?127.0.0.1 ?20000
//出现以下的信息
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
输入 stats 查看状态信息
安装libmemcached
要使用udf,必须安装libmemcached,这个比较恶心,尝试了很多很多版本,从0.38~最新的1.04,后面安装memcached_function_mysql均出现各种不同的报错,例如?
servers.c:263:28: error: ‘memcached_st’ has no member named ‘hosts’servers.c:264:28: error: ‘memcached_st’ has no member named ‘hosts’
最后使用0.34版,据说0.37 0.36等等也没问题(后来试了下0.37编译没问题,但是和memcached_functions_mysql-1.1后面会出问题)
tar -zxvf libmemcached-0.34.tar.gz
cd libmemcached-0.34
./configure --with-memcached=/usr/local/bin/memcached
make && make install
安装 memcached_function_mysql
tar -zxvf memcached_functions_mysql-1.1.tar.gz?
cd memcached_functions_mysql-1.1
./configure --prefix=/usr/local/memcached_mysql --with-mysql=/usr/local/mysql/bin/mysql_config --with-libmemcached=/usr/local
//指定lib