I have set up google cloud sql for my GCE(google compute engine) VM instance ,but I am unable to connect to the google cloud sql from VM instance .
In order to access the google cloud sql from the GCE ,I have requested for a Ipv4 address for the cloud sql host . Then I have added the external IP of the GCE to the Allow networks under the authorization section of google cloud sql setting .
Tried to access the cloud sql from the GCE with the Ipv4 address(as the host) and database user name and password using the following syntax
mysql --host=<instance-ip-address> --user=<user-name> --password
But getting the following error in response.
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0