mirror of
https://github.com/imjasonh/gcloud-help
synced 2026-07-08 18:45:13 +00:00
68 lines
2.5 KiB
Text
68 lines
2.5 KiB
Text
NAME
|
|
gcloud alpha sql import sql - imports data into a Cloud SQL instance from a
|
|
SQL dump file
|
|
|
|
SYNOPSIS
|
|
gcloud alpha sql import sql INSTANCE URI [--async]
|
|
[--database=DATABASE, -d DATABASE] [--user=USER] [GCLOUD_WIDE_FLAG ...]
|
|
|
|
DESCRIPTION
|
|
(ALPHA) gcloud alpha sql import sql imports data into a Cloud SQL instance
|
|
from a SQL dump file in Google Cloud Storage.
|
|
|
|
NOTE: Certain roles and permissions are required to import data into Google
|
|
Cloud SQL. For more information on importing data into Google Cloud SQL see
|
|
Import a SQL dump file
|
|
(https://cloud.google.com/sql/docs/mysql/import-export/import-export-sql#gcloud_1).
|
|
|
|
For detailed help on importing data into Cloud SQL, refer to this guide:
|
|
https://cloud.google.com/sql/docs/mysql/import-export/importing
|
|
|
|
EXAMPLES
|
|
To import data from a SQL dump file into a database, testdb, on the
|
|
specified Cloud SQL instance test-instance-1, run:
|
|
|
|
$ gcloud sql import sql test-instance-1 \
|
|
gs://test-bucket/test-file.sql.gz --database=testdb
|
|
|
|
POSITIONAL ARGUMENTS
|
|
INSTANCE
|
|
Cloud SQL instance ID.
|
|
|
|
URI
|
|
Path to the MySQL dump file in Google Cloud Storage from which the
|
|
import is made. The URI is in the form gs://bucketName/fileName.
|
|
Compressed gzip files (.gz) are also supported.
|
|
|
|
FLAGS
|
|
--async
|
|
Return immediately, without waiting for the operation in progress to
|
|
complete.
|
|
|
|
--database=DATABASE, -d DATABASE
|
|
Database to which the import is made. The database needs to be created
|
|
before importing. If not set, it is assumed that the database is
|
|
specified in the file to be imported. If your SQL dump file includes a
|
|
database statement, it will override the database set in this flag.
|
|
|
|
--user=USER
|
|
PostgreSQL user for this import operation.
|
|
|
|
GCLOUD WIDE FLAGS
|
|
These flags are available to all commands: --access-token-file, --account,
|
|
--billing-project, --configuration, --flags-file, --flatten, --format,
|
|
--help, --impersonate-service-account, --log-http, --project, --quiet,
|
|
--trace-token, --user-output-enabled, --verbosity.
|
|
|
|
Run $ gcloud help for details.
|
|
|
|
NOTES
|
|
This command is currently in alpha and might change without notice. If this
|
|
command fails with API permission errors despite specifying the correct
|
|
project, you might be trying to access an API with an invitation-only early
|
|
access allowlist. These variants are also available:
|
|
|
|
$ gcloud sql import sql
|
|
|
|
$ gcloud beta sql import sql
|
|
|