-
Notifications
You must be signed in to change notification settings - Fork 1
Cloud SQL Proxy
1.1. Install the latest SDK
https://cloud.google.com/sdk/docs/install
1.2. Initialize the SDK by running gcloud init and follow the application instructions
1.3. Authenticate by running gcloud auth login
2.1. Download Google’s latest cloud-sql-proxy binary release:
https://github.com/GoogleCloudPlatform/cloudsql-proxy/releases
For example, for Linux 64 bit run:
wget https://storage.googleapis.com/cloudsql-proxy/v1.20.1/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy
chmod +x cloud_sql_proxy
2.2. Move the cloud_sql_proxy executable to somewhere in your path so that it is discoverable
For example:
mv cloud_sql_proxy /usr/local/bin/cloud_sql_proxy
For example, the following command will establish a proxy connection to a Google Cloud SQL instance
cloud_sql_proxy -instances=[project-name]:[region]:[sql-instance-name]=tcp:5432
This will create a new connection socket listening on localhost:5432. Connect to this socket using the DB client / IDE of your choice (e.g. https://dbeaver.io/).