Status Update
Comments
kh...@google.com <kh...@google.com> #2
yo...@gmail.com <yo...@gmail.com> #3
ad...@gmail.com <ad...@gmail.com> #4
kh...@google.com <kh...@google.com> #5
zn...@gmail.com <zn...@gmail.com> #6
GA command:
$ gcloud --verbosity=debug sql connect psqlInstance1 --user=bobuser
DEBUG: Running [gcloud.sql.connect] with arguments: [--user: "bobuser", --verbosity: "debug", INSTANCE: "psqlInstance1"]
Whitelisting your IP for incoming connection for 5 minutes...done.
Connecting to database with SQL user [bobuser].DEBUG: Executing command: [u'psql', u'-h', u'192.168.1.1', u'-U', u'bobuser', u'-W']
Password for user bobuser:
psql: FATAL: database "bobuser" does not exist
Beta command:
$ gcloud --verbosity=debug beta sql connect psqlInstance1 --user=bobuser
DEBUG: Running [gcloud.beta.sql.connect] with arguments: [--user: "bobuser", --verbosity: "debug", INSTANCE: "psqlInstance1"]
Whitelisting your IP for incoming connection for 5 minutes...done.
Connecting to database with SQL user [bobuser].DEBUG: Executing command: [u'psql', u'-h', u'192.168.1.1', u'-U', u'bobuser', u'-W']
Password for user bobuser:
psql: FATAL: database "bobuser" does not exist
Gcloud info:
$ gcloud info
Google Cloud SDK [211.0.0]
Platform: [Linux, x86_64] ('Linux', 'cs-6000-devshell-vm-d853b350-fed4-4d5d-7f29-daede39fc0ba', '4.14.33+', '#1 SMP Sun Aug 5 10:53:14 PDT 2018', 'x86_64', '')
Python Version: [2.7.13 (default, Nov 24 2017, 17:33:09) [GCC 6.3.0 20170516]]
Python Location: [/usr/bin/python2]
Site Packages: [Disabled]
Installation Root: [/google/google-cloud-sdk]
Installed Components:
datalab: [20180503]
kubectl: []
container-builder-local: []
pubsub-emulator: [2018.02.02]
core: [2018.08.03]
app-engine-java: [1.9.64]
app-engine-python: [1.9.73]
app-engine-php: [ ]
docker-credential-gcr: []
app-engine-python-extras: [1.9.69]
beta: [2018.07.16]
gsutil: [4.33]
cloud-datastore-emulator: [2.0.1]
cbt: []
alpha: [2018.08.03]
gcd-emulator: [v1beta3-1.0.0]
app-engine-go: []
bq: [2.0.34]
System PATH: [/home/bobuser/bin:/home/bobuser/gopath/bin:/google/gopath/bin:/google/google-cloud-sdk/bin:/usr/local/go/bin:/opt/gradle/bin:/opt/maven/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/nvm/versions/node/v8.9.4/bin:/google/go_appengine:/google/google_appengine]
Python PATH: [/google/google-cloud-sdk/lib/third_party:/google/google-cloud-sdk/lib:/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload]
Cloud SDK on PATH: [True]
Kubectl on PATH: [/google/google-cloud-sdk/bin/kubectl]
WARNING: There are old versions of the Google Cloud Platform tools on your system PATH.
/google/go_appengine/dev_appserver.py
/google/go_appengine/endpointscfg.py
Installation Properties: [/google/google-cloud-sdk/properties]
User Config Directory: [/tmp/tmp.GASefIHPnC]
Active Configuration Name: [cloudshell-11324]
Active Configuration Path: [/tmp/tmp.GASefIHPnC/configurations/config_cloudshell-11324]
Account: [bobuser@domain.com]
Project: [bob-project]
Current Properties:
[metrics]
environment: [devshell]
[core]
project: [bob-project]
account: [bobuser@domain.com]
disable_usage_reporting: [False]
[component_manager]
disable_update_check: [True]
[compute]
gce_metadata_read_timeout_sec: [5]
Logs Directory: [/tmp/tmp.GASefIHPnC/logs]
Last Log File: [/tmp/tmp.GASefIHPnC/logs/2018.08.13/15.37.11.775017.log]
git: [git version 2.11.0]
ssh: [OpenSSH_7.4p1 Debian-10+deb9u3, OpenSSL 1.0.2l 25 May 2017]
kh...@google.com <kh...@google.com> #7
$ gcloud --verbosity=debug sql connect psqlInstance1 --user=bobuser --database=$MY_DATABASE
This is not yet available in the GA command.
zn...@gmail.com <zn...@gmail.com> #8
$ gcloud beta sql connect ${instance_name} --user=${user_name} --database=${database_name}
kh...@google.com <kh...@google.com> #9
th...@skale-5.com <th...@skale-5.com> #10
this works for us, except in one case:
- one developer uses Cloud Shell and he has restricted IAM rights.
- when he uses gcloud beta sql connect with --database= option, he gets an error (see screenshot)
Thanks !
[Deleted User] <[Deleted User]> #11
si...@gmail.com <si...@gmail.com> #12
kv...@gmail.com <kv...@gmail.com> #13
at...@gmail.com <at...@gmail.com> #14
Could you provide a quick correction to this issue? My instance is in europe-west1-b.
Regards
to...@octue.com <to...@octue.com> #15
cc...@sperdegroot.nl <cc...@sperdegroot.nl> #16
Any idea when this gets released to production? has been in Beta for a long time now
aj...@google.com <aj...@google.com>
ll...@google.com <ll...@google.com> #17
The beta version was no longer required for these instances since May 01, 2017, as per the
Today, I successfully connected to my Cloud SQL for PostgreSQL instance by specifying the --database and --user flags as follows:
$ gcloud sql connect ${instance_name} --user=${user_name} --database=${database_name}
Please refer to the
[Deleted User] <[Deleted User]> #18
Even when specifying the database, it tries to connect to the database with the user name
Is there any further configuration to enable this command?
su...@google.com <su...@google.com> #19
Hello,
Thank you for reaching our support.
Can you provide more details?
What exactly command have you used?
What version of 'gcloud' are you using?
su...@google.com <su...@google.com> #20
Hello,
As there is no update in this case I am closing it.
Please fill free to reopen if you need support.
pe...@gmail.com <pe...@gmail.com> #21
If this can not be fixed, maybe makes sense to update the documentation of "gcloud sql connect" accordingly:
pe...@deliveryhero.com <pe...@deliveryhero.com> #22
If this can not be fixed, maybe makes sense to update the documentation of "gcloud sql connect" accordingly:
su...@google.com <su...@google.com>
[Deleted User] <[Deleted User]> #23
I have created a postgres database with the name: 'backend' and a user "appengine". When specifying the database:
❯ gcloud sql connect <instance name> --user=appengine --database=backend
Allowlisting your IP for incoming connection for 5 minutes...done.
Connecting to database with SQL user [appengine].Password:
psql: error: FATAL: database "appengine" does not exist
I've had to specify the database using a postgres environment variable:
❯ PGDATABASE=backend gcloud sql connect <instance name>--user=appengine
su...@google.com <su...@google.com> #24
Hello,
I just tried to replicate the issue. Both commands:
gcloud beta sql connect
gcloud sql connect
Are working properly. So I am closing this case. If you still facing the issue please ensure that Cloud SDK is updated.
If this won't help please raise new bug with information how to replicate the issue.
a....@aetherworld.org <a....@aetherworld.org> #25
I just ran into the same issue:
$ gcloud sql connect my-sql-instance -u web -d staging
Allowlisting your IP for incoming connection for 5 minutes...done.
Connecting to database with SQL user [web].Password:
psql: error: FATAL: database "web" does not exist
It seems that this is really not fixed.
It is working with gcloud beta sql
though.
Description
Desired result: Offer, or require, a "--database" flag.
Connecting to a PostgreSQL (beta) instance with the "gcloud beta sql connect" command attempts to connect to a database of the same name as the string passed to the required "--user" flag. This is inflexible. Example:
$ gcloud beta sql connect platform-staging --user=foo
Whitelisting your IP for incoming connection for 5 minutes...done.
Connecting to database with SQL user [znorris].Password for user foo:
psql: FATAL: database "foo" does not exist
If the foo database existed a user "foo" would need to be created in order to connect via the gcloud sdk.