Ashesh Nair
Ashesh Nair

Reputation: 327

Access Google Cloud SQL from SDK Shell

I have created a PostgreSQL Instance in Google Cloud. I can access the Instance and perform SQL actions using the Cloud Shell.

When i try to access the same from my local using the 'Google Cloud SDK Shell', it fails to connect to the instance,

C:\Program Files (x86)\Google\Cloud SDK>gcloud sql connect [my-instance] --user==user-name
Whitelisting your IP for incoming connection for 5 minutes...done.
ERROR: (gcloud.sql.connect) Could not whitelist client IP. Server did not reply with the whitelisted IP.

I have replaced my-instance and user-name with correct entries Can someone guide me on how to access this database from my local SDK shell and not using the Cloud shell ?

Upvotes: 2

Views: 2663

Answers (1)

rsantiago
rsantiago

Reputation: 2099

There are some options to connect to your SQL instance depending on the client that you use, some of them are: Compute Engine, App Engine, mysql client, External applications.

I think your machine could be considered an external application, so you have to follow this guide to authorize your Windows client machine. However, the recommended way is using the cloudsqlproxy since it will free you from whitelisting all connections.

Hope it help you!

Upvotes: 3

Related Questions