This article covers methods to resolve Cloud SQL Proxy error.
The Cloud SQL Proxy error looks like this:
An attempt was made to access a socket in a way forbidden by its access permissions
Therefore you cannot bind to it while it's running:
The SQL Server engages the 3306 port locally.
1. Stop the SQL Server to bind the CloudSQL Proxy to it.
2. Incase of Windows 10: Go to Task Manager -> Services -> MySQL57
3. Right click and stop that task.
4. Once you have done that try running the same command again.
It'll work and show as output:
Listening on 127.0.0.1:3306 for <instance-name>
Requirements for using the Cloud SQL Auth proxy.
To use the Cloud SQL Auth proxy, you must meet the following requirements:
1. The Cloud SQL Admin API must be enabled.
2. You must provide the Cloud SQL Auth proxy with Google Cloud authentication credentials.
3. You must provide the Cloud SQL Auth proxy with a valid database user account and password.
4. The instance must either have a public IPv4 address, or be configured to use private IP.
The public IP address does not need to be accessible to any external address (it does not need to be added as an authorized network address).