title: How to connect to GCloud SQL database properly?
body: <p>Given is a PHP-Application running on Google App Engine, that needs a connection to GCloud SQL Instance with MySql in 2. Generation.</p>
  
  <p>I'm curious if i should use the IP-Address for any mysql-connection as stated in official <a href="https://cloud.google.com/sql/docs/mysql/external-connection-methods" rel="nofollow noreferrer">Google docs</a> or if we can use something like a hostname to prevent interruptions if Google might change the IP-address.</p>
  
  <p>What i can see so far in google cloud console is an instance-name like </p>
  
  <pre><code>my-example-instance:europe-west3:databasename
  </code></pre>
  
  <p>.</p>
  
  <p>But since they use colons in their names we aren't able to use this as a host-name (according to RFC 952 colons aren't valid characters for hostnames if i understood it correctly).</p>
  
  <p><strong>My questions:</strong></p>
  
  <ol>
  <li><p>Is it reliable to use ip-addresses for mysql-connection within GCloud applications (when an Application on Google App Engine connects to GCloud SQL Instance)?</p></li>
  <li><p>If not, can we get a stable, working hostname instead?</p></li>
  <li><p>If not, how is it done properly?</p></li>
  </ol>