Introduction
Generally, connection issues fall into one of the following three areas:
- Connecting - are you able to reach your instance over the network?
- Authorizing - are you authorized to connect to the instance?
- Authenticating - does the database accept your database credentials?
Each of those can be further broken down into different paths for investigation. The following section includes examples of questions you can ask yourself to help further narrow down the issue:
Connection issues checklist
- Connecting
- Private IP
- Have you enabled the
Service Networking APIfor your project? - Are you using a Shared VPC?
- Does your user or service account have the required IAM permissions to manage a private services access connection?
- Is private services access connection configured for your project?
- Did you allocate an IP address range for the private connection?
- Did your allocated IP address ranges contain at least a /24 space for every region where you are planning to create mysql instances?
- If you are specifying an allocated IP address range for your mysql instances, does the range contain at least a /24 space for every region where you are planning to create mysql instances in this range?
- Is the private connection created?
- If the private connection was changed, were the vpc-peerings updated?
- Do the VPC logs indicate any errors?
- Is your source machine's IP a non-RFC 1918 address?
- Public IP
- Is your source IP listed as an authorized network?
- Are SSL/TLS certificates required?
- Does your user or service account have the required IAM permissions to connect to a Cloud SQL instance?
- Authorizing
- Cloud SQL Auth Proxy
- Is the Cloud SQL Auth Proxy up to date?
- Is the Cloud SQL Auth Proxy running?
- Is the instance connection name formed correctly in the Cloud SQL Auth Proxy connection command?
- Have you checked the Cloud SQL Auth Proxy output? Pipe the output to a file, or watch the Cloud Shell terminal where you started the Cloud SQL Auth Proxy.
- Does your user or service account have the required IAM permissions to connect to a Cloud SQL instance?
- Have you enabled the
Cloud SQL Admin APIfor your project? - If you have an outbound firewall policy, make sure it allows connections to port 3307 on the target Cloud SQL instance.
- If you are connecting using UNIX domain sockets, confirm that the sockets were created by listing the directory specified with the -dir when you started the Cloud SQL Auth Proxy.
- Cloud SQL connectors and language-specific code
- Is the connection string formed correctly?
- Have you compared your code with the sample code for your programming language?
- Are you using a runtime or framework for which we don't have