[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-17(UTC)"],[],[],null,["# Importing and Exporting Data\n\nThis page describes how to use Cloud Tools for PowerShell to import and export\ndatabases and tables to and from your Cloud SQL instances.\n\nImporting and exporting data to and from your instances allows you to move\ndatabases from one instance to another. This is especially useful if you are\nmigrating your data to Cloud SQL instances.\n\nTo learn more about the requirements and best practices for importing and\nexporting data, see\n[Overview of Importing and Exporting Data](/sql/docs/import-export).\n\nFor both importing and exporting, make sure the relevant permissions are set up.\nYou must add the **Service Account Email Address** of the instance to the\nobject's permission, if it's in a Cloud Storage bucket (for\nimporting), or the bucket's permission (for exporting) as an **OWNER**.\n\nThis email is stored in the following snippet: \n\n```\n$instance = Get-GcSqlOperation -Instance \"mynewinstance\"\n$serviceEmail = $instance.ServiceAccountEmailAddress\n```\n\nImporting SQL and CSV files\n---------------------------\n\nYou can import an existing SQL dump or CSV file into an existing database inside\nyour Cloud SQL instances. This file must be either on your local\nmachine or in a Cloud Storage bucket.\n\nThe following snippet imports the data in a local CSV file into the table\n**destinationTable** inside of the database **destinationDatabase** in the\nCloud SQL instance **gootoso**: \n\n```\nImport-GcSqlInstance \"gootoso\" \"C:\\Users\\User\\file.csv\" `\n\"destinationDatabase\" \"destinationTable\"\n```\n| **Note:** Importing a file from a local machine causes a Cloud Storage bucket to be created, uploaded to, imported from, and deleted in your project. Standard billing rates apply.\n\nSimilarly, if a MySQL dump file is already in a Cloud Storage bucket,\nyou can import it into the database **destinationDatabase** of a specified\ninstance. For example: \n\n```\nImport-GcSqlInstance \"gootoso\" \"gs://bucket/file.gz\" `\n\"destinationDatabase\"\n```\n\nExporting SQL and CSV files\n---------------------------\n\nYou can export existing databases in a Cloud SQL instance into an\nexisting Cloud Storage bucket for further analysis, importing into\nother instances, and so on.\n\nThe following code snippit exports the database's **guestbook** and\n**Purchases** from the instance **gootoso** into a compressed file in a\nCloud Storage bucket. To export all databases to a compressed `.gz`\nSQL dump file, call: \n\n```\nExport-GcSqlInstance \"gootoso\" \"gs://bucket/file.gz\" `\n-Databases \"guestbook\",\"Purchases\"\n```"]]