英文:
How do run set command with memcached via netcat/telnet
问题
我尝试理解memcached并排除使用它的应用程序中的问题,但我很难执行set
命令。我正在按照这个教程操作:https://www.tutorialspoint.com/memcached/memcached_set_data.htm 这是我的尝试。
nc localhost 11211
set tutorialspoint 0 900 9
memcached
CLIENT_ERROR bad data chunk
我已经查看了几个其他教程,甚至查看了一个Golang客户端的源代码,它们似乎都像这样调用set
,但由于某种原因,它对我不起作用。
我在运行memcached版本1.6.19的arm MacBook上。
英文:
I'm trying to understand memcached and troubleshoot one of my applications that uses it, but I'm having a hard time executing the set
command. I'm following this tutorial here. <https://www.tutorialspoint.com/memcached/memcached_set_data.htm> Here is what I'm trying.
nc localhost 11211
set tutorialspoint 0 900 9
memcached
CLIENT_ERROR bad data chunk
I've looked at a couple of other tutorials and I've even looked at the source code of a Golang client and they all seem to be calling set
like this, but for some reason it's not working for me.
I'm on an arm MacBook running memcached version 1.6.19
答案1
得分: 0
After looking at some memcached clients and the memcached source code, I found that memcached is looking for the \r\n
line endings and Mac only uses the line feed (LF or \n).
To solve the problem with netcat, I followed this answer here. <https://superuser.com/questions/942217/how-do-i-interactively-type-r-n-terminated-query-in-netcat>. It says you can use the -C
option but that didn't work for me, and I had to type control-v
+ control-m
instead.
英文:
After looking at some memcached clients and the memcached source code, I found that memcached is looking for the \r\n
line endings and Mac only uses the line feed (LF or \n).
To solve the problem with netcat, I followed this answer here. <https://superuser.com/questions/942217/how-do-i-interactively-type-r-n-terminated-query-in-netcat>. It says you can use the -C
option but that didn't work for me, and I had to type control-v
+ control-m
instead.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论