【发布时间】:2011-08-17 03:13:05
【问题描述】:
我想用一个新的站点 URL 全局替换 Wordpress MySQL 数据库中我的站点 URL 的所有实例。为此,我使用 phpMyAdmin 将数据库导出到 .sql 文件,然后在文本编辑器中进行全局替换,然后使用 phpMyAdmin 导入 .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/', '', '2011-04-28 00:49:55', '2011-04-28 00:49:55'
,'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, 'post-trashed', '', '', 0, 0 ) ;
MySQL said:
#1062 - Duplicate entry '1' for key 'PRIMARY'
【问题讨论】:
-
@Johan - 感谢您进行编辑以使我的问题中的代码更清晰。
标签: mysql wordpress insert phpmyadmin