Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloud SQL Proxy error - An attempt was made to access a socket in a way forbidden by its access permissions

This is the error that comes up when I try to use Cloud SQL Proxy to configure access to Google Cloud SQL in windows - "listen tcp 127.0.0.1:3306: bind: An attempt was made to access a socket in a way forbidden by its access permissions."

This is the format of the command I'm using "cloud_sql_proxy.exe -dir=/cloudsql -instances=my-project:us-central1:sql-instance=tcp:3306 mysql -u --host " - as is described in the docs.

Can someone please let me know what's actually causing this ?

like image 945
opensourced101 Avatar asked Mar 18 '16 13:03

opensourced101


1 Answers

The SQL Server engages the 3306 port locally. Therefore you cannot bind to it while it's running. Stop the SQL Server to bind the CloudSQL Proxy to it.

Incase of Windows 10: Go to Task Manager -> Services -> MySQL57

Right click and stop that task. 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>
like image 52
Maverick7 Avatar answered Oct 15 '22 21:10

Maverick7