Reputation: 69
I am following the steps here, to setup a CloudSQL DB in Google Cloud Platform. I'm stuck at the step with:
./cloud_sql_proxy -instances="[YOUR_INSTANCE_CONNECTION_NAME]"=tcp:3306
I get the message below:
2018/02/07 19:44:10 listen tcp 127.0.0.1:3306: bind: address already in use
I've tried: lsof -i tcp:3306
but nothing shows up. Alternatively, I am able to start a connection to tcp:3307
, but that's not what's required in the tutorial, and may prevent the rest of the tutorial from working. When I do lsof -i tcp:3307
however, I am able to see the PID, and kill the SQL connection.
How is the port address 3306 already in use?? Even rebooted my computer.
Upvotes: 7
Views: 4561
Reputation: 698
I was running into the same issue, particularly not seeing anything on the specified port. The solution in my particular case was simply to delete the directory that my cloud sql proxies were set up to live in, then create it again. Worked like a charm after that.
Upvotes: 0
Reputation: 162
I stop Mysql on my local machine
brew services stop mysql
Directory to use for placing Unix sockets representing database instances
as seen by the console
error
Then I did
sudo mkdir /cloudsql; sudo chmod 777 /cloudsql
./cloud_sql_proxy -instances=MyInstanceConnName=tcp:3306 -projects=myproject -dir=/cloudsql/
Upvotes: 3
Reputation: 69
UPDATE: After trying to dig through many methods to kill the sql process, find out whats actually running on it, joining the gcloud slack group to ask around, etc etc, I ended up uninstalling mysql, and reinstalling it. Fixed it. :shrug:
Upvotes: -1