0
votes

Since yesterday, I am getting the following error while trying to connect to my Google Cloud SQL MySql database: ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0 My app is able to connect to the database, but I am unable to connect from my computer. I have configured my public ip address in Access Controls section.

I noticed one other thing. The public address I setup is not stored, and when I come back to the "Access Control" tab I see a different ip address from what I saved.

How do I access my Cloud SQL MySql instance through MySql client? Is there any other setting I need to do?

1
The IP that you whitelist on your Cloud SQL instsnce should not change. Are you sure is not your public IP the one that is changing?Juan Enrique Muñoz Zolotoochin
Smells like a dynamic IP problem -- if that's the case, the advice at cloud.google.com/sql/docs/access-control#dynamicIP can help. To verify the externally visible IP of your computer, visit e.g whatismyv6.com repeatedly and see if it's always the same... (assuming you're using IPv6 here, but even if you're on IPv4 that URL can help).Alex Martelli

1 Answers

1
votes

I figured this was a browser problem. The Google developer console on Mozilla was displaying the ip as updated although it was not updating it in the backend. I used Chrome to set this Access control in the Developer console and this worked fine.