Memcachedb and memcached engine cannot improve the query speed of the example search.

Source: Internet
Author: User

Memcachedb and memcached engine cannot improve the query speed of the example search.

Http://blog.s135.com/post/357/#entrymore

Since no one at home and abroad has written how to install memcache_engineArticleSo I wrote this article according to my own compilation and installation steps.

Memcache_engine is a storage engine for MySQL 5.1 databases. It allows users to access memcached through standard SQL statements (select/update/inserte/delete ).Memcachedb,Dbcached.

Restrictions:
1. The memcache table must have a primary key.
2. Only the primary key can be used for query. That is, only select... from... where id =... can be used for query.
3. Auto-increment IDs are not supported.

Installation and use:
1. Compile and install 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
# The steps for installing and configuring MySQL are omitted. do not compile and install MySql in static mode.

WgetHttp://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 ../

WgetHttp://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 ../

WgetHttp://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 ../

WgetHttp://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 ../

Note:The red flag is the source code path of MySQL 5.1.22 or later.

2. Copy libmemcache_engine.so to the default MySQL plug-in directory (assuming that MySQL is installed in the/usr/local/MySQL directory ):

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. Install the SQL statement of the libmemcache_engine.so plug-in:

Install plugin memcache soname 'libmemcache _ engine. so ';

4. Check whether the libmemcache_engine.so plug-in is successfully installed by using the following SQL statement:

Select * From mysql. plugin;
Show plugins;

5. Create an SQL statement for the memcache_engine table:

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 ';

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.