Http://dev.mysql.com/doc/refman/5.7/en/innodb-memcached.html
First, the test environment
mysql:5.7.15
Centos:6.6_x86_64
II. Installation and Deployment
1. Installing Libevent
# yum Install Libevent-y
2. Execute Configuration SQL
# Find/-name Innodb_memcached_config.sql
([email protected]) [(none)]> Source/usr/share/mysql/innodb_memcached_config.sql
3. Loading plugins
([email protected]) [test]> INSTALL PLUGIN daemon_memcached soname "libmemcached.so";
Third, testing
1. The default generated table
([email protected]) [test]> Show tables;
+----------------+
| Tables_in_test |
+----------------+
| Demo_test |
+----------------+
1 row in Set (0.00 sec)
2. Table structure
([email protected]) [test]> Show CREATE TABLE demo_test\g;
1. Row ***************************
Table:demo_test
Create table:create Table ' demo_test ' (
' C1 ' varchar (+) not NULL,
' C2 ' varchar (1024x768) DEFAULT NULL,
' C3 ' Int (one) DEFAULT NULL,
' C4 ' bigint () unsigned DEFAULT NULL,
' C5 ' int (one) DEFAULT NULL,
PRIMARY KEY (' C1 ')
) Engine=innodb DEFAULT Charset=utf8
1 row in Set (0.00 sec)
ERROR:
No query specified
3. Table Data
([email protected]) [test]> select * from Demo_test;
+----+--------------+------+------+------+
| C1 | C2 | C3 | C4 | c5 |
+----+--------------+------+------+------+
| AA | Hello, hello | 8 | 0 | 0 |
+----+--------------+------+------+------+
1 row in Set (0.00 sec)
4. Build the Database
([email protected]) [test]> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| Innodb_memcache | --New generation
| MySQL |
| Performance_schema |
| Test |
+--------------------+
5. The newly generated table
([email protected]) [test]> Use Innodb_memcache
Database changed
([email protected]) [innodb_memcache]> Show tables;
+---------------------------+
| Tables_in_innodb_memcache |
+---------------------------+
| cache_policies |
| config_options |
| Containers |
+---------------------------+
6. Table structure and content
([email protected]) [innodb_memcache]> select * from Containers\g;
1. Row ***************************
Name:aaa
Db_schema:test
Db_table:demo_test
Key_columns:c1
Value_columns:c2
Flags:c3
Cas_column:c4
Expire_time_column:c5
Unique_idx_name_on_key:primary
1 row in Set (0.00 sec)
ERROR:
No query specified
7.memcache default port 11211, can be modified
[Email protected] ~]# Netstat-antp|grep 11211
TCP 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 4241/mysqld
TCP 0 0::: 11211:::* LISTEN 4241/mysqld
8. Install test commands
# yum Install telnet NC
9. Read and write using Telnet
[[Email protected] ~]# telnet localhost 11211
Trying:: 1 ...
Connected to localhost.
Escape character is ' ^] '.
Get AA
VALUE AA 8 12
Hello, hello
END
Set BB 10 0 16
GOODBYE, GOODBYE
STORED
10. Verify that the data is modified
([email protected]) [test]> select * from Demo_test;
+----+------------------+------+------+------+
| C1 | C2 | C3 | C4 | c5 |
+----+------------------+------+------+------+
| AA | Hello, hello | 8 | 0 | 0 |
| BB | GOODBYE, GOODBYE | 10 | 1 | 0 | --Data has been modified
+----+------------------+------+------+------+
Specific theory View official documents
Http://dev.mysql.com/doc/refman/5.7/en/innodb-memcached.html
MySQL 5.7 innodb memcached plugin support in-memory database