1
votes

I'm trying to connect to my Google Cloud SQL instance from my desktop but am getting the following error:

ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

According to the docs this means that the client's IP isn't authorised to access the instance. I have done the standard "what's my ip" google search and added the IP to the "Authorised Networks" list of the instance (as well as a bunch of variations and /x ranges - none have worked, yes I restarted the instance). I have set a root password and even tried connecting with the necessary SSL certs - yields the same error.

I can connect to other (non-google) sql databases, I can ping the database, and I'm not behind any significant firewalls. How i'm typically trying to connect (also tried SSL):

mysql --host=the.instance.ip.add --user=root --password

Nothing I try seems to work.

I feel like I must be missing something obvious - any suggestions welcome (this is a nightmare).

2
Can you mail your instance-name to [email protected] and we will get back to you. - Aditya Mone
Just to be sure that the issue is on the authorized network, you can try authorizing "everything" (0.0.0.0/0). Obviously you should not keep this in the future for security reasons. - Juan Enrique Muñoz Zolotoochin
Google forbids authorising 0.0.0.0/0 - N S

2 Answers

0
votes

The "what's my ip" search on Google doesn't currently work properly when the ISP is proxying the web traffic transparently. Better information on the IP seems to be provided by Proxy Test from http://www.lagado.com/proxy-test.

-1
votes

Could you check again if you have authorized the correct IP address. If using your desktop from home, you may be having a private IP address for the desktop. What you really need to authorize is the public IP address.