innodb_memcache之使用

來源:互聯網
上載者:User

innodb_memcache之使用

innodb_memcache相容memcache協議,而且可以藉助於mysql本身的複製,讓memcache具備複製功能!

  1. GET[root@www share]# echo 'get aa'|nc localhost 11222VALUE aa 0 12HELLO, HELLOEND
  2. get特殊用法2.1 通過@@擷取key所在定義名[root@www share]# echo 'get @@aaa'|nc localhost 11222VALUE @@aaa 0 23test_memcache/demo_testEND2.2 通過@@name.key_name擷取定義名下的key[root@www share]# echo 'get @@aaa.aa'|nc localhost 11222VALUE @@aaa.aa 0 12HELLO, HELLOEND
  3. set[root@www share]# telnet localhost 11222Trying 127.0.0.1...Connected to localhost.Escape character is '^]'.set aa 0 0 3abcSTORED
  4. get多欄位組合key在innodb_memcache基礎資料表中加入memcache key中繼資料 INSERT INTO innodb_memcache.containers  VALUES ("bbb", "test", "demo_test","c1", "c1|c2|c3|c4|c5|",  "c3", "c4", "c5", "PRIMARY");這條語句表示的含義是,獲得bbb中繼資料組下key的資料為c1|c2|c3|c4|c5|[root@www share]# echo 'get @@bbb.aa'|nc localhost 11222VALUE @@bbb.aa 0 12aa|abc|0|9|0END
  5. 更新key結構若發現想更改bbb中繼資料的key對應的value為c1|c2|c3,直接更新innodb_memcache.containers,發現並不能獲得對應的value為c1|c2|c3.若想要使修改生效,則需要重啟mysql或者是卸載memcache外掛程式後,再安裝一次;另外的方法就是建立一個中繼資料ccc  INSERT INTO containers VALUES ("ccc", "test", "demo_test",                               "c1", "c1|c2|c3",  "c3", "c4", "c5", "PRIMARY");
  6.  

    set更新多欄位組合key        需要安裝中繼資料中的格式排列更新    如更新bbb,則更新語句為    [root@www share]# telnet localhost 11222    Trying 127.0.0.1...Connected to localhost.Escape character is '^]'.    set @@bbb.aa 0 0 12aa|acc|0|9|0    STORED                我們再次擷取bbb,發現已經更新為了acc    get @@bbb.aa    VALUE @@bbb.aa 0 12    aa|acc|0|9|0    END

innodb_memcache之使用

innodb_memcache之安裝

innodb_memcache之配置

MySQL Server 層和 InnoDB 引擎層 體繫結構圖

本文永久更新連結地址:

相關文章

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.