1

I'm trying to kill a Redis client by user, as per the docs, but I get a syntax error in redis-cli:

redis:6379> client kill user my_client
(error) ERR syntax error
redis:6379> info
# Server
redis_version:5.9.102

What's the correct syntax for this command?

Alex Deva
  • 17
  • 5

1 Answers1

0

According to the this commit (May 1,2020) which is commited to the unstable version, your syntax is correct. But it is not released to the stable versions such as the one you used.

If you want to remove client by ip:port format then you need something like this;

127.0.0.1:6379> client list
id=272 addr=127.0.0.1:51374 fd=8 name= age=66 idle=1 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=26 qbuf-free=32742 obl=0 oll=0 omem=0 events=r cmd=client
id=273 addr=127.0.0.1:51376 fd=9 name= age=19 idle=16 flags=P db=0 sub=1 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=subscribe
127.0.0.1:6379> client kill 127.0.0.1:51376
OK
127.0.0.1:6379>
Ersoy
  • 8,816
  • 6
  • 34
  • 48
  • Thanks! That's useful to know. I used killing by id instead. Perhaps the live documentation should reflect the stable version (and fix the typo in that paragraph). – Alex Deva May 24 '20 at 11:49
  • @AlexDeva I opened an issue on the github about the typo yesterday. They may update it. If the answer is okay on your side, please approve it - it may help to someone else. – Ersoy May 24 '20 at 16:05
  • 1
    Thank you! Sorry about forgetting to approve the answer. Thanks for reminding me. – Alex Deva May 25 '20 at 18:06