phpMyAdmin错误 - SQL查询

时间:2016-09-24 09:41:08

标签: sql phpmyadmin xampp

phyMyAdmin的新手,在导入sql zip文件时,我收到以下错误消息:

INSERT INTO `wp_easycontactforms_acl` (`id`, `objtype`, `method`, `name`, `role`) VALUES
(928, 'CustomFormEntryFiles', 'new', 'main', 'SuperAdmin'),
(929, 'Tasks', 'viewDetailed', 'main', 'Owner'),
(930, 'ContactField2', 'show', 'main', 'Owner'),
(931, 'TaskTypes', 'show', 'main', 'Owner'),
(932, 'ContactField1', 'view', 'main', 'SuperAdmin'),
(933, 'OrderFiles', 'viewDetailed', 'detailedMain', 'SuperAdmin'),
(934, 'Products', 'new', 'main', 'SuperAdmin'),
(935, 'Files', 'upload', 'main', 'SuperAdmin'),
(936, 'OrderField1', 'view', 'main', 'SuperAdmin'),
(937, 'ContactField1', 'show', 'main', 'SuperAdmin'),
(938, 'CustomFormFields', 'fixOrder', 'main', 'SuperAdmin'),
(939, 'DashBoardView', 'getDashboardAPIText', 'main', 'Owner'),
(940, 'CustomFormEntryStatistics', 'dismissPointer', 'main', 'SuperAdmin'),
(941, 'OrderField1', 'show', 'main', 'SuperAdmin'),
(942, 'Users', 'show', 'main', 'Owner'),
(943, 'CustomFormFields', 'addCustomField', 'main', 'Owner'),
(944, 'OrderStatuses', 'view'[...]
MySQL said: Documentation

#1062 - Duplicate entry '928' for key 'PRIMARY'

我应该做什么?请有人指出这个新手正朝着正确的方向前进。

由于 Amarnath

1 个答案:

答案 0 :(得分:0)

是的,存在约束问题。它会给出错误,因为在插入过程中会发现id为928的多个条目,并且您为该列提供了主/唯一键,或者某些列具有唯一键约束,并且查询尝试插入重复条目(相同该列的值)。因此,只需检查索引的所有列(唯一键)。