PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #145
At Nimbus Retail you manage a Cloud SQL for MySQL instance called reporting-sql-01. The team needs to export a full database to Cloud Storage and later import it back into the same instance using gclo
The correct answer is C. gcloud sql export sql reporting-sql-01 gs://example-bucket-42/retail_backup.sql.gz -. The gcloud sql export sql command exports the database as a mysqldump SQL file (optionally gzip-compressed when the destination ends in .gz), which can be directly re-imported with gcloud sql import sql-no format conversion required. Option A uses export csv, which produces a fla
Question
At Nimbus Retail you manage a Cloud SQL for MySQL instance called reporting-sql-01. The team needs to export a full database to Cloud Storage and later import it back into the same instance using gcloud without doing any format conversion. Which command should you run to create the export so that it can be imported back into Cloud SQL?
Options
- Agcloud sql export csv reporting-sql-01 gs://example-bucket-42/retail_backup.sql.gz -
- Bgsutil cp gs://example-bucket-42/retail_backup.sql.gz | gcloud sql import sql reporting-sql-01 -
- Cgcloud sql export sql reporting-sql-01 gs://example-bucket-42/retail_backup.sql.gz -
- Dgcloud sql import csv reporting-sql-01 gs://example-bucket-42/export.csv -database=analyticsdb -
How the community answered
(46 responses)- A2% (1)
- B13% (6)
- C80% (37)
- D4% (2)
Explanation
The gcloud sql export sql command exports the database as a mysqldump SQL file (optionally gzip-compressed when the destination ends in .gz), which can be directly re-imported with gcloud sql import sql-no format conversion required. Option A uses export csv, which produces a flat CSV file that cannot be used directly with import sql and requires schema recreation separately. Option B pipes gsutil output into an import command, which is not valid gcloud syntax. Option D uses import csv, which is an import command, not an export, and requires a pre-existing schema.
Topics
Community Discussion
No community discussion yet for this question.