Import Mysql on Google Cloud

In the Cloud Shell of the ProjectFollow the URLhttps://cloud.google.com/sql/docs/mysql/import-export/import-export-sql#gcloud_11. Create a Cloud Storage bucket.Upload the file to your bucket.2. For he...

P
Prem Mohan Tyagi
1 min | 109 words
Import Mysql on Google Cloud

In the Cloud Shell of the Project

Follow the URL
https://cloud.google.com/sql/docs/mysql/import-export/import-export-sql#gcloud_1

1. Create a Cloud Storage bucket.

Upload the file to your bucket.

2. For help with uploading files to buckets, see Uploading objects.

3. Describe the instance you are importing to:

gcloud sql instances describe INSTANCE_NAME

4. Copy the serviceAccountEmailAddress field.

Use gsutil iam to grant the storage.objectAdmin IAM role to the service account for the bucket.

5. gsutil iam ch serviceAccount:SERVICE-ACCOUNT:objectAdmin \ gs://BUCKET-NAME

For help with setting IAM permissions, see Using IAM permissions.

Import the database:

6. gcloud sql import sql INSTANCE_NAME gs://BUCKET_NAME/IMPORT_FILE_NAME \ --database=DATABASE_NAME


Share this article

P

Written by

Prem Mohan Tyagi