File: //snap/google-cloud-cli/396/help/man/man1/gcloud_beta_sql_import_sql.1
.TH "GCLOUD_BETA_SQL_IMPORT_SQL" 1
.SH "NAME"
.HP
gcloud beta sql import sql \- imports data into a Cloud SQL instance from a SQL dump file
.SH "SYNOPSIS"
.HP
\f5gcloud beta sql import sql\fR \fIINSTANCE\fR \fIURI\fR [\fB\-\-async\fR] [\fB\-\-clean\fR] [\fB\-\-database\fR=\fIDATABASE\fR,\ \fB\-d\fR\ \fIDATABASE\fR] [\fB\-\-if\-exists\fR] [\fB\-\-parallel\fR] [\fB\-\-threads\fR=\fITHREADS\fR] [\fB\-\-user\fR=\fIUSER\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(BETA)\fR gcloud beta 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
.SH "EXAMPLES"
To import data from a SQL dump file into a database, \f5testdb\fR, on the
specified Cloud SQL instance \f5test\-instance\-1\fR, run:
.RS 2m
$ gcloud sql import sql test\-instance\-1 \e
gs://test\-bucket/test\-file.sql.gz \-\-database=testdb
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
\fIINSTANCE\fR
Cloud SQL instance ID.
.TP 2m
\fIURI\fR
Path to the MySQL dump file in Google Cloud Storage from which the import is
made. The URI is in the form \f5gs://bucketName/fileName\fR. Compressed gzip
files (.gz) are also supported.
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-async\fR
Return immediately, without waiting for the operation in progress to complete.
.TP 2m
\fB\-\-clean\fR
Option to clean (DROP) database objects before recreating them. corresponds to
the clean flag for pg_restore. Only applies if \-\-parallel is set. PostgreSQL
only.
.TP 2m
\fB\-\-database\fR=\fIDATABASE\fR, \fB\-d\fR \fIDATABASE\fR
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.
.TP 2m
\fB\-\-if\-exists\fR
Include an SQL statement (IF EXISTS) with each DROP statement produced by
\-\-clean; corresponds to the if\-exists flag for pg_restore. Only applies if
\-\-parallel is set. PostgreSQL only.
.TP 2m
\fB\-\-parallel\fR
Perform a parallel import. This flag is only applicable to MySQL and Postgres.
.TP 2m
\fB\-\-threads\fR=\fITHREADS\fR
Specifies the number of threads to use for the parallel import. If
\f5\-\-parallel\fR is specified and this flag is not provided, Cloud SQL uses a
default thread count to optimize performance.
.TP 2m
\fB\-\-user\fR=\fIUSER\fR
PostgreSQL user for this import operation.
.RE
.sp
.SH "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 \fB$ gcloud help\fR for details.
.SH "NOTES"
This command is currently in beta and might change without notice. These
variants are also available:
.RS 2m
$ gcloud sql import sql
.RE
.RS 2m
$ gcloud alpha sql import sql
.RE