wish help you to fix your issue You need to register the IPV6 address from which you'll be coming into Google Cloud SQL, among the authorized addresses on the Cloud SQL console. You can check that IPv6 address e.g by visiting sites such as whatismyv6.com .
it helps some times Sigh...The solution was right in front of my face. I needed to grant the Google App Server IPs. Im sure you could add more code to connect over ssh and its more secure but this is fine for now. Here are IP address range:
ERROR 2013 (HY000) while connecting to Google Cloud Sql MySql database from mysql client
around this issue 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.
This might help you First thing's last.. Do not use mysql_ instead use mysqli_ for all the reasons on this you can check this : Stackoverflow mysql_ Moving on from that, there is no reason you should think of connecting to a MySQL server any different just because of how its hosted. Cloud is a wonderfull Buzz word.. But its nothing new, its still just a host.
Hope that helps Just like you connect IPv4-to-IPv4 addresses, you need to connect IPv6-to-IPv6 addresses. Your ISP needs to support IPv6 and issue you an IPv6 prefix from which your IPv6 addresses originate. If you have IPv6 Privacy Extensions enabled on your Macintosh, your source IPv6 address will periodically change, and that could be a problem for your connection. Don't try to use Link-Local IPv6 addresses (start with fe80:). You will need Global IPv6 addresses (start with 2xxx: or 3xxx:).