导入UC 1.6 数据备份的SQL文件时出现如下提示:
[Err] 1062 - Duplicate entry '︷嘴在逞強?' for key 'username'
[Err] INSERT INTO `uc_members` VALUES (18672,'︷嘴在逞強?',..............);
[Msg] Finished - Unsuccessfully
--------------------------------------------------
[Err] 1062 - Duplicate entry '嘴在逞強' for key 'username'
[Err] INSERT INTO `uc_members` VALUES (45267,'嘴在逞強',..............);
[Msg] Finished - Unsuccessfully
--------------------------------------------------
[Err] 1062 - Duplicate entry 'Līsā' for key 'username'
[Err] INSERT INTO `sh0527_uc_members` VALUES (29640,'Līsā',.........);
[Msg] Finished - Unsuccessfully
--------------------------------------------------
[Err] 1062 - Duplicate entry 'lisa' for key 'username'
[Err] INSERT INTO `sh0527_uc_members` VALUES (51784,'lisa',.........);
[Msg] Finished - Unsuccessfully
--------------------------------------------------
错误编号:1062
问题分析:向唯一字段插入相同数据。
解决方法:
1、由于在备份MySQL数据库时过程中把gbk编码转换为utf8编码,造成把SQL文件导入到utf8编码的新数据库时提示存在重复的用户名,其实是因为utf8编码把 '︷嘴在逞強?'和 '嘴在逞強' 识别为相同的字符,'Līsā' 和'lisa'也识别为相同的用户名造成的。
解决方法是在导入前,先在数据库中删除或者修改用户名'Līsā'和 '︷嘴在逞強?',执行完之后就可以顺利的进行相应的导入SQL操作。
|
|