title: Access Cloud SQL from App Engine
body: <p>I have the following <code>Dockerfile</code>:</p>
  
  <pre><code>FROM gcr.io/google-appengine/openjdk
  
  ...
  
  EXPOSE 8080
  
  WORKDIR /app
  ENTRYPOINT exec java $JAVA_OPTS $SERVICE_OPTS -jar Server.jar
  </code></pre>
  
  <p>This starts a Spring Boot project, served by a Tomcat server. In order to start, spring boot needs database access for it's JPA components:</p>
  
  <pre><code># Spring Datasource
  spring.datasource.url=jdbc:google:mysql://INSTANCE_NAME/DATABASE?user=db-user&amp;password=*******
  spring.datasource.driverClassName=com.mysql.jdbc.Driver
  spring.datasource.username=db-user
  spring.datasource.password=********
  </code></pre>
  
  <p>My <code>app.yaml</code>:</p>
  
  <pre><code>runtime: custom
  env: flex
  
  beta_settings:
       cloud_sql_instances: INSTANCE_NAME
  </code></pre>
  
  <p>I still haven't figured out how to establish the cloud sql connection. Any ideas?</p>