【发布时间】:2015-10-23 01:29:00
【问题描述】:
我正在尝试将从本地 XAMPP 安装导出的 (Wordpress) 数据库导入 Google 云 SQL 数据库。
我按照Google documentation的步骤,完成了以下步骤:
- 我用 PHPmyadmin 从本地 XAMPP 导出了 .sql 文件(仅尝试了数据和结构和数据) 安装。
- 我创建了一个 Google Cloud 存储桶并上传了我的 .sql 文件。
- 我选择了我的实例并点击了“导入”
- 在bucket中插入文件.sql文件的路径
- 并指定了我的数据库
现在我收到以下错误:
mysql_query Duplicate entry '1' for key 'PRIMARY' (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', '', 'https://wordpress.org/', '',
'2015-07-11 09:58:54', '2015-07-11 09:58:54', 'Hi, this is a comment.\nTo
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))
我在导入之前安装了一个 wordpress 数据库,所以也许我需要删除现有数据库,或者在上传新数据库之前将其留空?但在我看来,您通常可以通过现有数据库上传 .sql 文件,对吧?
【问题讨论】:
标签: php mysql wordpress google-app-engine google-cloud-sql