ubuntu环境 mysql memcached udf 完整安装
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.gzcd libmemcached-0.34./configure --with-memcached=/usr/local/bin/memcachedmake && make install安装 memcached_function_mysqltar -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//指定libmemcached的目录,不然会报libmemcached not foundmake && make install将/usr/local/memcached_mysql/lib下的文件复制到mysql的lib中sudo cp /usr/local/memcached_mysql/lib/libmemcached_functions_mysql.* /usr/local/mysql/lib/plugin/同时,在mysql中添加udf函数,在解压的memcached_functions_mysql-1.1安装包文件夹下的/sql文件夹下,有两个sql文件,启动mysql服务并连接,在mysql中运行mysql>?use xxx // use某个databasemysql> source /xxxx/memcached_functions_mysql-1.1/sql/install_functions.sql ?//(这一步,0.37的libmemcached会出问题,函数对应不上)mysql> source /xxxx/memcached_functions_mysql-1.1/sql/trigger_fun.sqlmysql>?select * from mysql.func;? //查看导入的函数就大功告成!!如果make install过程中报错说没有权限访问啥啥的,就用 sudo make install 或者通过 sudo su root 切换到root用户吧。。。??转载请注明源?http://asyty.iteye.com/blog/1442587