1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-08 10:35:03 +00:00
gcloud-help/gcloud/sql/connect
2022-03-01 04:29:52 +00:00

50 lines
1.4 KiB
Text

NAME
gcloud sql connect - connects to a Cloud SQL instance
SYNOPSIS
gcloud sql connect INSTANCE [--database=DATABASE, -d DATABASE]
[--user=USER, -u USER] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
Connects to a Cloud SQL instance.
This command temporarily changes the authorized networks for this instance
to allow the connection from your IP address.
NOTE: If you're connecting from an IPv6 address, or are constrained by
certain organization policies (restrictPublicIP,
restrictAuthorizedNetworks), consider running the beta version of this
command to avoid error by connecting through the Cloud SQL proxy: gcloud
beta sql connect
EXAMPLES
To connect to a Cloud SQL instance, run:
$ gcloud sql connect my-instance --user=root
POSITIONAL ARGUMENTS
INSTANCE
Cloud SQL instance ID.
FLAGS
--database=DATABASE, -d DATABASE
The SQL Server database to connect to.
--user=USER, -u USER
Cloud SQL instance user to connect as.
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
These variants are also available:
$ gcloud alpha sql connect
$ gcloud beta sql connect