[root@sunss24 libmemcached-0.34]#./configure / --with-memcached=/home/memcache/bin/memcached [root@sunss24 libmemcached-0. 34]# make [root@sunss24 libmemcached-0. 34]# make install 再运行一下memstat,算成功了 [root@sunss24 ~]# ln -s /usr/local/lib/libmemcached.so.3 /usr/lib/ [root@sunss24 ~]# cd memcached_functions_mysql-0.9 [root@sunss24 memcached_functions_mysql-0.9]# ./configure / --with-mysql=/usr/local/mysql/bin/mysql_config / --libdir=/usr/local/mysql/lib/ [root@sunss memcached_functions_mysql-0.9]# make && make install
安装完成后将UDFs加载到MySQL中:
复制代码 代码如下:
mysql> show variables like "%plugin%"; +---------------+-----------------------------------+ | Variable_name | Value | +---------------+-----------------------------------+ | plugin_dir | /usr/local/mysql/lib/mysql/plugin | +---------------+-----------------------------------+ 1 row in set (0.00 sec)
[root@sunss ~]# find / -name "libmemcached_functions_mysql.so" /usr/local/mysql/lib/libmemcached_functions_mysql.so /root/memcached_functions_mysql-0.9/src/.libs/libmemcached_functions_mysql.so You have new mail in /var/spool/mail/root [root@sunss ~]# cp /usr/local/mysql/lib/libmemcached_functions_mysql.so /usr/local/mysql/lib/mysql/plugin/ [root@sunss ~]# cd memcached_functions_mysql-0.9/ [root@sunss ~]#cd sql/ mysql> source install_functions.sql;
查看各种版本:
复制代码 代码如下:
mysql> select memc_udf_version(); +--------------------+ | memc_udf_version() | +--------------------+ | 0.9 | +--------------------+ 1 row in set (0.00 sec)
mysql> select memc_libmemcached_version(); +-----------------------------+ | memc_libmemcached_version() | +-----------------------------+ | 0.34 | +-----------------------------+ 1 row in set (0.00 sec)