mysql5.7innodbmemcachedplugin支持內(nèi)存數(shù)據(jù)庫

http://dev.MySQL.com/doc/refman/5.7/en/innodb-memcached.html

成都創(chuàng)新互聯(lián)公司-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比涼山州網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式?jīng)錾街菥W(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋涼山州地區(qū)。費(fèi)用合理售后完善,10余年實(shí)體公司更值得信賴。

一、測(cè)試環(huán)境

mysql:5.7.15

centos:6.6_x86_64

二、安裝部署

1.安裝libevent

# yum install libevent -y

2.執(zhí)行配置sql

# find /  -name innodb_memcached_config.sql 

(root@localhost) [(none)]> source /usr/share/mysql/innodb_memcached_config.sql

3.加載插件

(root@localhost) [test]> INSTALL PLUGIN daemon_memcached soname "libmemcached.so";

三、測(cè)試

1.默認(rèn)生成的表

(root@localhost) [test]> show tables;

+----------------+

| Tables_in_test |

+----------------+

| demo_test      |

+----------------+

1 row in set (0.00 sec)

2.表結(jié)構(gòu)

(root@localhost) [test]> show create table demo_test\G;

*************************** 1. row ***************************

       Table: demo_test

Create Table: CREATE TABLE `demo_test` (

  `c1` varchar(32) NOT NULL,

  `c2` varchar(1024) DEFAULT NULL,

  `c3` int(11) DEFAULT NULL,

  `c4` bigint(20) unsigned DEFAULT NULL,

  `c5` int(11) DEFAULT NULL,

  PRIMARY KEY (`c1`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8

1 row in set (0.00 sec)

ERROR: 

No query specified

3.表數(shù)據(jù)

(root@localhost) [test]> select * from demo_test;

+----+--------------+------+------+------+

| c1 | c2           | c3   | c4   | c5   |

+----+--------------+------+------+------+

| AA | HELLO, HELLO |    8 |    0 |    0 |

+----+--------------+------+------+------+

1 row in set (0.00 sec)

4.生成數(shù)據(jù)庫

(root@localhost) [test]> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| innodb_memcache    |   --新生成

| mysql              |

| performance_schema |

| test               |

+--------------------+

5.新生成的表

(root@localhost) [test]> use innodb_memcache

Database changed

(root@localhost) [innodb_memcache]> show tables;

+---------------------------+

| Tables_in_innodb_memcache |

+---------------------------+

| cache_policies            |

| config_options            |

| containers                |

+---------------------------+

6.表結(jié)構(gòu)以及內(nèi)容

(root@localhost) [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 默認(rèn)端口11211,可以修改

[root@mysql5 ~]# 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.安裝測(cè)試命令

# yum install telnet nc

9.使用telnet 進(jìn)行讀寫

[root@mysql5 ~]# 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.驗(yàn)證數(shù)據(jù)是否修改

(root@localhost) [test]> select * from demo_test;

+----+------------------+------+------+------+

| c1 | c2               | c3   | c4   | c5   |

+----+------------------+------+------+------+

| AA | HELLO, HELLO     |    8 |    0 |    0 |

| BB | GOODBYE, GOODBYE |   10 |    1 |    0 |   --數(shù)據(jù)已修改

+----+------------------+------+------+------+

具體理論看官方文檔

http://dev.mysql.com/doc/refman/5.7/en/innodb-memcached.html

網(wǎng)站欄目:mysql5.7innodbmemcachedplugin支持內(nèi)存數(shù)據(jù)庫
網(wǎng)頁路徑:http://muchs.cn/article44/gpjdhe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營(yíng)銷、響應(yīng)式網(wǎng)站網(wǎng)站設(shè)計(jì)公司、動(dòng)態(tài)網(wǎng)站、網(wǎng)頁設(shè)計(jì)公司、商城網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站優(yōu)化排名