[文章作者:张宴 本文版本:v1.1 最后修改:2008.09.09 转载请注明原文链接:http://blog.zyan.cc/post/357/]

  鉴于国内外还没有人撰写如何安装Memcache_engine的文章,于是,我根据自己的编译安装步骤,写下此文。

  Memcache_engine是一个MySQL 5.1数据库的存储引擎,它能够让用户通过标准的SQL语句(SELECT/UPDATE/INSERTE/DELETE)访问Memcached(还支持新浪的Memcachedbdbcached)中存放的数据。

  限制:
  1、Memcache表必须有主键。
  2、只能使用主键去查询,即只能使用SELECT ... FROM ... WHERE id = ... 方式去查询。
  3、不支持自增ID。

  安装与使用:
  1、编译安装memcache_engine的步骤:
cd /tmp
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.26-rc.tar.gz/from/http://mirror.x10.com/mirror/mysql/
tar zxvf mysql-5.1.26-rc.tar.gz
#安装、配置MySQL的步骤省略,注意不要以静态方式编译安装。

wget http://download.tangent.org/libmemcached-0.23.tar.gz
tar zxvf libmemcached-0.23.tar.gz
cd libmemcached-0.23/
./configure --prefix=/usr/local/memcache_engine
make
make install
cd ../

wget http://xmlsoft.org/sources/libxml2-2.6.32.tar.gz
tar zxvf libxml2-2.6.32.tar.gz
cd libxml2-2.6.32/
./configure --prefix=/usr/local/memcache_engine
make
make install
cd ../

wget http://download.tangent.org/libxmlrow-0.2.tar.gz
tar zxvf libxmlrow-0.2.tar.gz
cd libxmlrow-0.2/
export PKG_CONFIG_PATH=/usr/local/memcache_engine/lib/pkgconfig/
./configure --prefix=/usr/local/memcache_engine
make
make install
cd ../

wget http://download.tangent.org/memcache_engine-0.7.tar.gz
tar zxvf memcache_engine-0.7.tar.gz
cd memcache_engine-0.7/
sed -i "s#uint16_t#uint32_t#g" ./src/ha_memcache.cc
export PKG_CONFIG_PATH=/usr/local/memcache_engine/lib/pkgconfig/
./configure --prefix=/usr/local/memcache_engine --with-mysql=/tmp/mysql-5.1.26-rc
make
make install
cd ../

  注意:红色标记部分为MySQL 5.1.22以上版本的源码路径。

  2、拷贝libmemcache_engine.so到MySQL默认插件目录(假设MySQL安装在/usr/local/mysql目录下):
mkdir -p /usr/local/mysql/lib/mysql/plugin/
cp /usr/local/memcache_engine/lib/libmemcache_engine.so.0.0.0 /usr/local/mysql/lib/mysql/plugin/libmemcache_engine.so


  3、安装libmemcache_engine.so插件的SQL语句:
INSTALL PLUGIN memcache SONAME 'libmemcache_engine.so';


  4、查看libmemcache_engine.so插件是否安装成功的SQL语句:
SELECT * FROM mysql.plugin;
SHOW PLUGINS;


  5、创建一张memcache_engine表的SQL语句:
CREATE TABLE `table` (
`id` int(11) NOT NULL DEFAULT '0',
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MEMCACHE DEFAULT CHARSET=latin1
CONNECTION='localhost:11211';





技术大类 » Cache与存储 | 评论(64) | 引用(0) | 阅读(74134)
aa
2020-1-22 23:38
webflowwebflownethouseangelfire
Ieuan Ventura
2021-10-20 18:03
Getting clear, action-oriented feedback can increase employee engagement and retention, so regular in-depth performance reviews are important. Do you find it helpful also? This my way to show my gratitude on every open site that is also been helpful to my own research. Thanks as always  สมัครเกมสล็อต
shz Email
2022-7-31 16:00
I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!  Scam Risk
shz Email
2022-7-31 16:03
I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts.  Scam Risk
shz Email
2022-7-31 16:14
Hi! This is my first visit to your blog! We are a team of volunteers and new initiatives in the same niche. Blog gave us useful information to work. You have done an amazing job!  Scam Risk
shz Email
2022-7-31 16:24
We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work  Scam Risk
shz Email
2022-7-31 16:29
Super site! I am Loving it!! Will return once more, Im taking your food additionally, Thanks.  Scam Risk
shz Email
2022-7-31 16:34
Nice knowledge gaining article. This post is really the best on this valuable topic.  Scam Risk
shz Email
2022-7-31 16:44
It proved to be Very helpful to me and I am sure to all the commentators here!  Scam Risk
shz Email
2022-7-31 16:50
You completed a number of nice points there. I did a search on the issue and found nearly all people will have the same opinion with your blog.  Scam Risk
shz Email
2022-7-31 16:57
This is very educational content and written well for a change. It's nice to see that some people still understand how to write a quality post!  Scam Risk
shz Email
2022-8-18 22:12
Nice knowledge gaining article. This post is really the best on this valuable topic.  online business
shz Email
2022-8-18 22:16
Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post.  online business
shzz Email
2022-8-18 22:16
Hello! I just wish to give an enormous thumbs up for the nice info you've got right here on this post. I will probably be coming back to your weblog for more soon!  online business
shz Email
2022-8-18 22:19
Interesting post. I Have Been wondering about this issue, so thanks for posting. Pretty cool post.It 's really very nice and Useful post.Thanks  online business
shzz Email
2022-8-18 22:21
Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post.  online business
shz Email
2022-8-18 22:23
I really loved reading your blog. It was very well authored and easy to understand. Unlike other blogs I have read which are really not that good.Thanks alot!  online business
shzz Email
2022-8-18 22:25
I see the greatest contents on your blog and I extremely love reading them.  online business
shz Email
2022-8-18 22:28
Took me time to understand all of the comments, but I seriously enjoyed the write-up. It proved being really helpful to me and Im positive to all of the commenters right here! Its constantly nice when you can not only be informed, but also entertained! I am certain you had enjoyable writing this write-up.  online business
shzz Email
2022-8-18 22:30
Very nice blog and articles. I am realy very happy to visit your blog. Now I am found which I actually want. I check your blog everyday and try to learn something from your blog. Thank you and waiting for your new post.  online business
分页: 3/4 第一页 上页 1 2 3 4 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]