title: Rails 5, Google Container Engine and Google Cloud SQL
body: <p>I'm trying to connect a Rails app deployed in Google Container Engine to a database hosted in Google Cloud SQL.</p>
  
  <p>I'm following <a href="https://cloud.google.com/sql/docs/mysql/connect-container-engine" rel="nofollow noreferrer">this documentation</a>. According to it, my pods have two containers: spike and cloudsql-proxy.</p>
  
  <p>In this page, we can read the following line:</p>
  
  <blockquote>
    <p>Provide 127.0.0.1:3306 as the host address your application uses to access the database.</p>
  </blockquote>
  
  <p>At the very end of the process, I get this:</p>
  
  <p>Return of <code>kubectl logs [pod_name] cloudsql-proxy</code></p>
  
  <pre><code>2017/05/03 09:50:43 Listening on 127.0.0.1:3306 for [instance_connection_name]
  2017/05/03 09:50:43 Ready for new connections
  </code></pre>
  
  <p>And in <code>kubectl exec -it  [pod_name] -- /bin/bash</code>, return of <code>cat log/production.log</code></p>
  
  <pre><code>ActionView::Template::Error (Unknown MySQL server host '127.0.0.1:3306' (25))
  </code></pre>
  
  <p>Isn't it fun?</p>