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 引擎層 體繫結構圖

本文永久更新連結地址:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.