Thursday, July 5, 2018

[google-cloud-sql-discuss] failure to connect to MySQL instance on cloudsql socket (GAE Python flex environment)

Following the instructions here:
https://cloud.google.com/appengine/docs/flexible/python/using-cloud-sql
  • 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)".




--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/eccf5add-2b35-45c6-aa62-1a271f0b6cca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment