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

115 weergaven
Naar het eerste ongelezen bericht

Eric G

ongelezen,
5 jul 2018, 18:15:0205-07-2018
aan 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

ongelezen,
6 jul 2018, 11:09:1906-07-2018
aan 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.
Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten