1

在此处输入图像描述

接下来是以下步骤:

telnet localhost 11211
set Test 0 100 10
get Test 
CLIENT_ERROR bad data chunk
ERROR
set amit 2 2 2 
get amit 
CLIENT_ERROR bad data chunk
ERROR
4

3 回答 3

2

'set Test 0 100 10',然后输入一个长度等于10的值。</p>

于 2020-05-17T08:27:06.897 回答
2

在我的情况下,我提供了值,但字节并不完全是我在 set 命令中提到的,因为命令的格式是:

set KEY META_DATA EXPIRY_TIME LENGTH_IN_BYTES

因此,对于那些只是复制粘贴命令而不知道它为什么不存储密钥并来到这里寻求答案的人来说,这可能会有所帮助:

您需要提供与您在 set 命令的最后一个参数中提到的完全相同的字节值

以下将不起作用:

在此处输入图像描述

以下也不会:

在此处输入图像描述

因此,当您输入值时,它必须是完全相同的字节,如下所示:

在此处输入图像描述

于 2021-01-03T13:30:18.363 回答
2

Although you do not ask a specific question, i presume you want to store a value. You could test with the default example from the Memcached manual.

You define that you want to store a key, but don't specify a value.

The following example specifies that you want to save a key "tutorialspoint", no flags, timeout of 900 and reserve 9 bytes for a value. Those 9 bytes are specified in the next line: "memcached". In your example i don't see a value.

set tutorialspoint 0 900 9
memcached
STORED

get tutorialspoint
VALUE tutorialspoint 0 9
memcached

END
于 2017-04-27T10:57:09.957 回答