Error importing SQL dump from bucket (exported from Google Cloud Console)

已查看 233 次
跳至第一个未读帖子

Brett Peary

未读,
2018年4月25日 12:58:572018/4/25
收件人 Google Cloud SQL discuss
I have a Google App Engine project running Wordpress and everything is working fine on that. I exported the Cloud SQL instance to a bucket in that project and then transferred to a bucket in an new Google App Engine project where I want to import the SQL instance. 

I've tried importing through the Google Cloud Console, but I get an unknown error, so I switched to the command line utility. 

Here are the commands I've run following the doc here... 


gcloud sql instances describe  myapp-wp-db-app-v2

// the serviceAccountEmailAddress (a fake version of it)

// gsutil acl ch -u [SERVICE_ACCOUNT_ADDRESS]:W gs://[BUCKET_NAME]
gsutil acl ch -u hvintl4c5h3...@sparkle-boots-23.iam.gserviceaccount.com:W gs://import-myapp-wp-app-v2

// gsutil acl ch -u [SERVICE_ACCOUNT_ADDRESS]:R gs://[BUCKET_NAME]/[IMPORT_FILE_NAME]
gsutil acl ch -u hvintl4c5h3...@sparkle-boots-23.iam.gserviceaccount.com:R gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52)/

// gcloud sql import sql [INSTANCE_NAME] gs://[BUCKET_NAME]/[IMPORT_FILE_NAME] \
                            --database=[DATABASE_NAME]
gcloud sql import sql myapp-wp-db-app-v2 gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52)/ \
                            --database=wordpress_db


The last command gives me the following in the command line utility..
Importing data into Cloud SQL instance...failed.
ERROR: (gcloud.sql.import.sql) ERROR_RDBMS
and " gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52)/: Not found (bad bucket name?)" in the Console's operations log.

This command below (without a trailing slash) give me unknown error...
gcloud sql import sql myapp-wp-db-app-v2 gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52) \
                            --database=wordpress_db


The documentation says that if you have "ERROR_RDBMS" that it is probably related to permissions and did not elaborate.Since I exported the SQL dump from Cloud SQL, I thought that it would have the correct permissions need to import back in to Cloud SQL. 

Any idea how to handle this?

Cheers.

Kamran (Google Cloud Support)

未读,
2018年4月25日 20:05:212018/4/25
收件人 google-cloud...@googlegroups.com

I posted a solution for your issue on this link.




On Wednesday, April 25, 2018 at 12:58:57 PM UTC-4, Brett Peary wrote:
I have a Google App Engine project running Wordpress and everything is working fine on that. I exported the Cloud SQL instance to a bucket in that project and then transferred to a bucket in an new Google App Engine project where I want to import the SQL instance. 

I've tried importing through the Google Cloud Console, but I get an unknown error, so I switched to the command line utility. 

Here are the commands I've run following the doc here... 


gcloud sql instances describe  myapp-wp-db-app-v2

// the serviceAccountEmailAddress (a fake version of it)

// gsutil acl ch -u [SERVICE_ACCOUNT_ADDRESS]:W gs://[BUCKET_NAME]
gsutil acl ch -u hvintl4c5h3uot6h7e5vfxz@sparkle-boots-23.iam.gserviceaccount.com:W gs://import-myapp-wp-app-v2

// gsutil acl ch -u [SERVICE_ACCOUNT_ADDRESS]:R gs://[BUCKET_NAME]/[IMPORT_FILE_NAME]
gsutil acl ch -u hvintl4c5h3uot6h7e5vfxz@sparkle-boots-23.iam.gserviceaccount.com:R gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52)/

// gcloud sql import sql [INSTANCE_NAME] gs://[BUCKET_NAME]/[IMPORT_FILE_NAME] \
                            --database=[DATABASE_NAME]
gcloud sql import sql myapp-wp-db-app-v2 gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52)/ \
                            --database=wordpress_db


The last command gives me the following in the command line utility..

Brett Peary

未读,
2018年4月25日 20:15:562018/4/25
收件人 Google Cloud SQL discuss
Thank you. This post was a duplicate. I didn't not see the notification saying that the post will be reviewed, and I thought I had lost it, so I wrote another one. 

I was able to get around my import issue by using the Console. I read in another thread that you have to export and import specific databases not a whole instance. 

回复全部
回复作者
转发
0 个新帖子