The Core Distribution includes the psql client.
The Cloud SQL Auth Proxy binary you download depends on your operating system, and whether it uses a 32-bit or 64-bit kernel. Most newer hardware uses a 64-bit kernel. If you're unsure whether your machine is running a 32-bit or 64-bit kernel, then use the uname -a
command for Linux or macOS. For Windows, see the Windows documentation.
curl-ocloud-sql-proxyhttps://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v2.15.2/cloud-sql-proxy.linux.amd64
chmod+xcloud-sql-proxy
curl-ocloud-sql-proxyhttps://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v2.15.2/cloud-sql-proxy.linux.386
curl
command is not found, run sudo apt install curl
and repeat the download command.chmod+xcloud-sql-proxy
curl-ocloud-sql-proxyhttps://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v2.15.2/cloud-sql-proxy.darwin.amd64
chmod+xcloud-sql-proxy
curl-ocloud-sql-proxyhttps://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v2.15.2/cloud-sql-proxy.darwin.arm64
chmod+xcloud-sql-proxy
cloud-sql-proxy.exe
. cloud-sql-proxy.exe
. The Cloud SQL Auth Proxy has different container images, such as distroless
, alpine
, and buster
. The default Cloud SQL Auth Proxy container image uses distroless
, which contains no shell. If you need a shell or related tools, then download an image based on alpine
or buster
. For more information, see Cloud SQL Auth Proxy Container Images.
You can pull the latest image to your local machine using Docker by using the following command:
docker pull gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.15.2
In the Google Cloud console, go to the Cloud SQL Instances page.
projectID:region:instanceID
.Start the Cloud SQL Auth Proxy in its own terminal so you can monitor its output. Replace INSTANCE_CONNECTION_NAME
with the instance connection name you copied in the previous step.
For Linux environments, use this command to launch the Cloud SQL Auth Proxy:
./cloud-sql-proxyINSTANCE_CONNECTION_NAME
In PowerShell on Windows, use this command to launch the Cloud SQL Auth Proxy:
.\cloud-sql-proxy.exeINSTANCE_CONNECTION_NAME
A message similar to the following appears:
Listening on 127.0.0.1:5432 for INSTANCE_CONNECTION_NAME Ready for new connections
Run the following command after replacing DB_NAME with the name of the Cloud SQL database:
psql"host=127.0.0.1 port=5432 sslmode=disable dbname=DB_NAME user=postgres"
At the Enter password: prompt, enter the password of your PostgreSQL account.
Verify that the PostgreSQL prompt appears. You have connected to your database using the psql client.
Return to the terminal window where you started the Cloud SQL Auth Proxy. You should see a message similar to the following:
New connection for myInstance
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
In the Google Cloud console, go to the Cloud SQL Instances page.
myinstance
instance to open the Instance details page.If you're not using the APIs that were enabled as part of this quickstart, you can disable them.
In the Google Cloud console, go to the APIs page.
Select the Cloud SQL Admin API and then click the Disable API button.
See how to troubleshoot information for the Cloud SQL Auth Proxy.
Learn more about the Cloud SQL Auth Proxy.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-04-17 UTC.