LinuxCommandLibrary

gcloud-sql-export-sql

exports Cloud SQL data to storage

TLDR

Export database to Cloud Storage

$ gcloud sql export sql [instance] [gs://bucket/file.sql] --database [db_name]
copy
Export all databases
$ gcloud sql export sql [instance] [gs://bucket/file.sql]
copy
Export asynchronously
$ gcloud sql export sql [instance] [gs://bucket/file.sql] --async
copy

SYNOPSIS

gcloud sql export sql instance uri [options]

DESCRIPTION

gcloud sql export sql exports data from a Cloud SQL instance to a SQL dump file stored in Google Cloud Storage. The command creates a database backup in standard SQL format that can be imported into other database systems or restored to Cloud SQL instances.
The tool supports both MySQL and PostgreSQL instances. Exports can target specific databases or tables, or dump all databases at once. The async mode allows long-running exports to continue in the background without blocking the terminal. Offloading exports to read replicas minimizes performance impact on production instances.

PARAMETERS

--database name

Database to export.
--table name
Tables to export.
--async
Don't wait for completion.
--offload
Offload to replica.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community