#1062 - Duplicate entry '李珊珊' for key 'uniqueName'

在为user表的 username 字段添加唯一约束时,mysql报错 #1062 - Duplicate entry ‘李珊珊’ for key ‘uniqueName’,因为该列已经存在重复值了,所以先要删除重复数据再添加唯一约束。 再执行 create unique index uniqueName on user (username);
相关文章
相关标签/搜索