Memcached基本操作
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Memcached基本操作相关的知识,希望对你有一定的参考价值。
1 、连接memcached
[[email protected] ~]# telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is ‘^]‘.
2、退出
[[email protected] ~]# telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is ‘^]‘.
quit
Connection closed by foreign host.
[[email protected] ~]#
2、设置
[[email protected] ~]# telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is ‘^]‘.
set key1 0 300 2 #key1:表示键值 0: 标记 300:过期时间 2:大小双字节
12 #存的值
STORED #表示存储好了
get key1 #取
VALUE key1 0 2
12
END
3、查看chunk
[[email protected] ~]# memcached-tool 127.0.0.1:11211 display
# Item_Size Max_age Pages Count Full? Evicted Evict_Time OOM
1 96B 1819s 1 1 no 0 0 0
以上是关于Memcached基本操作的主要内容,如果未能解决你的问题,请参考以下文章