failure to connect to MySQL instance on cloudsql socket (GAE Python flex environment)

115 views
Skip to first unread message

Eric G

unread,
Jul 5, 2018, 6:15:02 PM7/5/18
to Google Cloud SQL discuss
Following the instructions here:
  • I have specified the unix_socket  as /cloudsql/project:location:instance .  (i.e. the instance connection name, not just the instance ID)
  • I have added it to the beta_settings, cloud_sql_instances in app.yaml.
  • I am connecting as a db user created through the Google Console from "any host" (%)  -- but it also happens with the root user too
  • I am connecting using the pymysql library
  • This is during deployment to GAE Python flex environment, and the cloudsql instance is in the same project, so the GAE service account should be authorized.
From the traceback (below), it does appear to try to open a socket connection, rather than TCP/IP, but fails with the message "Can't connect to MySQL server on 'localhost' ([Errno 2] No such file or directory)".




Eric G

unread,
Jul 6, 2018, 11:09:19 AM7/6/18
to Google Cloud SQL discuss
Er, nevermind. The settings are correct, but I was trying to open a db connection before the service was completely updated, instead of per request.
Reply all
Reply to author
Forward
0 new messages