snippetbashTip
gcloud sql export sql — Export data from a Cloud SQL instance to an SQL file in Google Cloud Storage. Useful for creating ba
Viewed 0 times
commandcloudfromcliexportsqldatagcloud sql export sql
Problem
How to use the
gcloud sql export sql command: Export data from a Cloud SQL instance to an SQL file in Google Cloud Storage. Useful for creating backups or migrating data. See also: gcloud. More information: <https://docs.cloud.google.com/sdk/gcloud/reference/sql/export/sql>.Solution
gcloud sql export sql — Export data from a Cloud SQL instance to an SQL file in Google Cloud Storage. Useful for creating backups or migrating data. See also: gcloud. More information: <https://docs.cloud.google.com/sdk/gcloud/reference/sql/export/sql>.Export data from a specific Cloud SQL instance to a Google Cloud Storage bucket as an SQL dump file:
gcloud sql export sql {{instance}} gs://{{bucket_name}}/{{file_name}}Export data asynchronously, returning immediately without waiting for the operation to complete:
gcloud sql export sql {{instance}} gs://{{bucket_name}}/{{file_name}} --asyncExport data from specific databases within the Cloud SQL instance:
gcloud sql export sql {{instance}} gs://{{bucket_name}}/{{file_name}} --database={{database1,database2,...}}Export specific tables from a specified database within the Cloud SQL instance:
gcloud sql export sql {{instance}} gs://{{bucket_name}}/{{file_name}} --database={{database}} --table={{table1,table2,...}}Export data while offloading the operation to a temporary instance to reduce strain on the source instance:
gcloud sql export sql {{instance}} gs://{{bucket_name}}/{{file_name}} --offloadExport data and compress the output with
gzip:gcloud sql export sql {{instance}} gs://{{bucket_name}}/{{file_name}}.gzCode Snippets
Export data from a specific Cloud SQL instance to a Google Cloud Storage bucket as an SQL dump file
gcloud sql export sql {{instance}} gs://{{bucket_name}}/{{file_name}}Export data asynchronously, returning immediately without waiting for the operation to complete
gcloud sql export sql {{instance}} gs://{{bucket_name}}/{{file_name}} --asyncExport data from specific databases within the Cloud SQL instance
gcloud sql export sql {{instance}} gs://{{bucket_name}}/{{file_name}} --database={{database1,database2,...}}Export specific tables from a specified database within the Cloud SQL instance
gcloud sql export sql {{instance}} gs://{{bucket_name}}/{{file_name}} --database={{database}} --table={{table1,table2,...}}Export data while offloading the operation to a temporary instance to reduce strain on the source instance
gcloud sql export sql {{instance}} gs://{{bucket_name}}/{{file_name}} --offloadContext
tldr-pages: common/gcloud sql export sql
Revisions (0)
No revisions yet.