Posted at

memcachedコマンド操作

More than 3 years have passed since last update.


telnetで接続

# telnet localhost 11211

Trying ::1...
Connected to localhost.
Escape character is '^]'.


データの格納

set key1 0 0 6

value1
STORED


データの取得

get key1

VALUE key1 0 6
value1
END


データの書換

replace key1 0 0 6

value2
STORED


格納されているデータの後ろに追記

append key1 0 0 6

value3
STORED
get key1
VALUE key1 0 12
value2value3


格納されているデータの前に追記

prepend key1 0 0 6

value1
STORED
get key1
VALUE key1 0 18
value1value2value3
END


データの削除

delete key1

DELETED


データの加算/減算

set key1 0 0 3

100
STORED
incr key1 1000
1100
decr key1 2000
0
delete key1
DELETED


切断

quit

Connection closed by foreign host.
#