【发布时间】:2014-02-02 11:17:26
【问题描述】:
我已获得要上传到我的服务器的数据库文件,但在导入时收到以下错误消息。我已经搜索过其他类似的问题,但不知道如何解决这个问题。
SQL 查询:
--
-- Dumping data for table `wp_comments`
--
INSERT INTO `wp_comments` (
`comment_ID` ,
`comment_post_ID` ,
`comment_author` ,
`comment_author_email` ,
`comment_author_url` ,
`comment_author_IP` ,
`comment_date` ,
`comment_date_gmt` ,
`comment_content` ,
`comment_karma` ,
`comment_approved` ,
`comment_agent` ,
`comment_type` ,
`comment_parent` ,
`user_id`
)
VALUES
(
1,
1,
'Mr WordPress',
'',
'http://wordpress.org/',
'',
'0000-00-00 00:00:00',
'0000-00-00 00:00:00',
'Hi, this is a comment.<br />To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.',
0,
'1',
'',
'',
0,
0
);
MySQL 说:
#1062- 键“PRIMARY”的重复条目“1”
【问题讨论】:
-
似乎您正在尝试插入一个已经存在的值,其中只允许唯一值。我假设它是“comment_ID”。
-
请转储您的 wp_cmets 表 CREATE 语句
-
请阅读并解释错误信息,它包含解决问题所需的所有信息。
-
错误很明显,不知道还能怎么判断。