title: Problem App Engine app to connect to MySQL in CloudSQL
body: <p>I've configured SQL second gen. instance  and App Engine application (Python 2.7) in one project. I've made necessary settings according to <a href="https://cloud.google.com/appengine/docs/standard/python/cloud-sql/using-cloud-sql-mysql" rel="nofollow noreferrer">that page</a>. </p>
  
  <p><strong>app.yaml</strong> </p>
  
  <pre><code>runtime: python27
  api_version: 1
  threadsafe: true
  env_variables:
      CLOUDSQL_CONNECTION_NAME: coral-heuristic-215610:us-central1:db-basic-1
      CLOUDSQL_USER: root
      CLOUDSQL_PASSWORD: xxxxxxxxx     
  beta_settings:
      cloud_sql_instances: coral-heuristic-215610:us-central1:db-basic-1
  libraries:
  - name: lxml
    version: latest
  - name: MySQLdb
    version: latest
  handlers:   
  - url: /main
    script: main.app
  </code></pre>
  
  <p>Now as I try to <strong>connect from the app</strong> (inside Cloud Shell), the error:</p>
  
  <pre><code>OperationalError: (2002, 'Can\'t connect to local MySQL server through socket \'/var/run/mysqld/mysqld.sock\' (2 "No such file or directory")')
  </code></pre>
  
  <p><strong>Direct connection works:</strong> </p>
  
  <pre><code>$ gcloud sql connect db-basic-1 --user=root
  </code></pre>
  
  <p>was successful...</p>
  
  <pre><code>MySQL [correction_dict]&gt; SHOW PROCESSLIST;                                                                                                     
  +--------+------+----------------------+-----------------+---------+------+----------+------------------+
  | Id     | User | Host                 | db              | Command | Time | State    | Info             |
  +--------+------+----------------------+-----------------+---------+------+----------+------------------+
  |      9 | root | localhost            | NULL            | Sleep   |    4 |          | NULL             |
  |     10 | root | localhost            | NULL            | Sleep   |    4 |          | NULL             |
  | 112306 | root | 35.204.173.246:59210 | correction_dict | Query   |    0 | starting | SHOW PROCESSLIST |
  | 112357 | root | localhost            | NULL            | Sleep   |    4 |          | NULL             |
  | 112368 | root | localhost            | NULL            | Sleep   |    0 |          | NULL             |
  +--------+------+----------------------+-----------------+---------+------+----------+------------------+
  </code></pre>
  
  <p><strong>I've authorized IP to connect to the Cloud SQL instance</strong>:
  <a href="https://i.stack.imgur.com/LcEr0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LcEr0.jpg" alt="The IP are authorized to connect Cloud SQL instance."></a></p>
  
  <h2>Any hints, help?</h2>