Cloud SQL Auth Proxy: failed to connect — IAM permission, API or IAM DB authentication problem
The proxy can't create a connection to the instance because of credentials, permissions or configuration.
Cloud SQL Auth Proxy failed to connectcloud-sql-proxy: failed to connect to instance: Dial errorCloud SQL Admin API has not been used in project before or it is disabledgoogleapi: Error 403: Not authorized to access resource. Possibly missing permission cloudsql.instances.connectfailed to get instance: Refresh error Meaning
Give the proxy's identity roles/cloudsql.client, enable the Cloud SQL Admin API, use the right instance connection name (project:region:instance), check IAM database authentication settings and database user type, and ensure the proxy reaches the instance's IP type (public/private).
Common causes
- Missing
cloudsql.clientrole - Cloud SQL Admin API disabled
- Wrong instance connection name
- IAM DB auth user not created
- Private IP only but proxy outside the VPC
⚡ Quick fix
- Grant
roles/cloudsql.client - Enable
sqladmin.googleapis.com - Verify the connection name with
gcloud sql instances describe
Detailed fix by platform
Shell
- bash
gcloud services enable sqladmin.googleapis.com ./cloud-sql-proxy PROJECT:REGION:INSTANCE --private-ip
How to diagnose
- Role — cloudsql.client?
- API — Enabled?
- Connection name — Correct?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 10054 SQL Server error 10054: An existing connection was forcibly closed by the remote host
- 40 SQL Server Error 40: Could not open a connection to SQL Server (Named Pipes Provider)
- API has not been used in project before or it is disabled Google Cloud: 403 SERVICE_DISABLED — Cloud Resource Manager API has not been used in project 123456 before or it is disabled. Enable it by visiting
Most viewed in Google Cloud / Firebase
- Missing or insufficient permissions Firestore: FirebaseError: [code=permission-denied]: Missing or insufficient permissions
- Container failed to start Cloud Run: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable
- 409: The resource already exists Compute Engine: ERROR: (gcloud.compute.instances.create) Could not fetch resource: The resource 'projects/p/zones/z/instances/vm-1' already exists
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 18 Nov 2026