1:(error) WRONGTYPE Operation against a key holding the wrong kind of value
今天打开redis输入命令zadd k 1 maqian 2 xiaoming 3 xiaohua
报错,百度了一下出现这个问题的原因是已经存在一个别的类型的键k
,把原来的k
删除即可。
127.0.0.1:6379> zadd k 1 maqian 2 xiaoming 3 xiaohua
(error) WRONGTYPE Operation against a key holding the wrong kind of value
127.0.0.1:6379> keys *
1) "rs"
2) "dst"
3) "k" # 已经存在了一个k
4) "k2"
5) "k3"
127.0.0.1:6379> del k
(integer) 1
127.0.0.1:6379> zadd k 1 maqian 2 xiaoming 3 xiaobai
(integer) 3
此处评论已关闭