File: //snap/google-cloud-cli/current/help/man/man1/gcloud_alpha_sql_connect.1
.TH "GCLOUD_ALPHA_SQL_CONNECT" 1
.SH "NAME"
.HP
gcloud alpha sql connect \- connects to a Cloud SQL instance
.SH "SYNOPSIS"
.HP
\f5gcloud alpha sql connect\fR \fIINSTANCE\fR [\fB\-\-database\fR=\fIDATABASE\fR,\ \fB\-d\fR\ \fIDATABASE\fR] [\fB\-\-debug\-logs\fR] [\fB\-\-port\fR=\fIPORT\fR;\ default=9470] [\fB\-\-run\-connection\-test\fR] [\fB\-\-skip\-ssl\fR] [\fB\-\-auto\-iam\-authn\fR\ |\ \fB\-\-user\fR=\fIUSER\fR,\ \fB\-u\fR\ \fIUSER\fR] [\fB\-\-auto\-ip\fR\ |\ \fB\-\-private\-ip\fR\ |\ \fB\-\-psc\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR Connects to a Cloud SQL instance.
.SH "EXAMPLES"
To connect to a Cloud SQL instance, run:
.RS 2m
$ gcloud alpha sql connect my\-instance \-\-user=root
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
\fIINSTANCE\fR
Cloud SQL instance ID.
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-database\fR=\fIDATABASE\fR, \fB\-d\fR \fIDATABASE\fR
The PostgreSQL or SQL Server database to connect to.
.TP 2m
\fB\-\-debug\-logs\fR
Enable verbose debug logs for Cloud SQL Proxy.
.TP 2m
\fB\-\-port\fR=\fIPORT\fR; default=9470
Port number that gcloud will use to connect to the Cloud SQL Proxy through
localhost.
.TP 2m
\fB\-\-run\-connection\-test\fR
Run connection test for Cloud SQL Proxy.
.TP 2m
\fB\-\-skip\-ssl\fR
Skip SSL certificate verification for MySQL instances.
.TP 2m
User selection settings for Cloud SQL Proxy connection.
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-auto\-iam\-authn\fR
Enables IAM database authentication for connections to MySQL and Postgres
instances.
.TP 2m
\fB\-\-user\fR=\fIUSER\fR, \fB\-u\fR \fIUSER\fR
Cloud SQL instance user to connect as.
.RE
.sp
.TP 2m
IP address selection settings for Cloud SQL Proxy connection.
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-auto\-ip\fR
Connect to the Cloud SQL instance with auto IP detection.
.TP 2m
\fB\-\-private\-ip\fR
Connect to the Cloud SQL instance using private IP.
.TP 2m
\fB\-\-psc\fR
Connect to the Cloud SQL instance using PSC.
.RE
.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 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:
.RS 2m
$ gcloud sql connect
.RE
.RS 2m
$ gcloud beta sql connect
.RE