Yes like Subhash said it's the same situation for me. I had to spin a compute engine because of this. I discovered that i had to add the compute engine's external ip to cloud sql's allowed networks list.
I have the sql admin access scope for the compute engine but still I couldn't use unix socket or directly sql host ip without adding the gce external ip to cloudsql. I think won't be able to use auto scaling because of this? In the same way for flexible environment If I have to add VM instances' ip do cloudsql then again iam losing the ability of autoscaling and all the other app engine features. I am currently running my work on gce, I really like to run it on gae flex custom runtime. It's for production environment Can someone from the support team help me with this, please? On Saturday, 3 June 2017 01:07:08 UTC+12, Subash PS wrote: > > it is connected from appengine standard environment > > > > > > *Thanks & RegardsSubash.P.S* > > > > > On 2 June 2017 at 11:11, Takashi Matsuo <[email protected] > <javascript:>> wrote: > >> Do you guys have sqladmin API enabled? >> You can check it at: >> https://console.cloud.google.com/apis/api/sqladmin.googleapis.com/overview >> >> On Sun, May 28, 2017 at 8:29 PM Subash PS <[email protected] >> <javascript:>> wrote: >> >>> I amm also facing the same issue >>> >>> app.yaml >>> >>> env: flex >>> runtime: php >>> runtime_config: >>> document_root: . >>> env_variables: >>> # Replace project, instance, database, user and password with the >>> values obtained >>> # when configuring your Cloud SQL instance. >>> MYSQL_DSN: mysql:unix_socket=/cloudsqlxxxxxxxxxxxxxxxxxxx;dbname=testdb >>> >>> MYSQL_USER: root >>> MYSQL_PASSWORD: xxxxxxxxxxxxxx >>> MYSQL_DATABASE : testdb >>> w >>> beta_settings: >>> cloud_sql_instances: "xxxxxxxxxxxxxx" >>> >>> >>> code sample >>> >>> $dsn = getenv('MYSQL_DSN'); >>> $username = getenv('MYSQL_USER'); >>> $password = getenv('MYSQL_PASSWORD'); >>> $options = array( >>> PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', >>> ); >>> try{ >>> $dbh = new PDO($dsn, $username, $password, $options); >>> echo "conneced";exit; >>> }catch(Exception $e) { >>> print $e->getMessage();exit; >>> } >>> >>> On Friday, 30 September 2016 03:41:22 UTC+5:30, Kevin Lau wrote: >>>> >>>> >>>> down votefavorite >>>> <http://stackoverflow.com/questions/39778544/why-does-my-php-app-engine-not-connect-to-cloud-sql#> >>>> >>>> I am trying to connect my app engine PHP app to cloud sql via unix >>>> socket (I assume that is correct so that I don't have to connect to the >>>> ip). The connect via IP works but the unix socket does not. Any ideas? >>>> It's >>>> also weird that when I ssh into the box, I don't see any /cloudsql/ >>>> directory. I can create it by manually starting cloud_sql_proxy but that >>>> doesn't persist as soon as I turn debug off. >>>> >>>> >>>> I'm using: $db = new pdo( >>>> 'mysql:unix_socket=/cloudsql/testproject-xxxxxx:us-central1:library;dbname=books', >>>> >>>> 'phpapp', // username 'somepw' // password ); >>>> >>>> And get SQLSTATE[HY000] [2002] No such file or directory >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Google App Engine" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected] <javascript:>. >>> To post to this group, send email to [email protected] >>> <javascript:>. >>> Visit this group at https://groups.google.com/group/google-appengine. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/google-appengine/cd70cbcf-c973-4c32-b54d-06e00aabbf56%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/google-appengine/cd70cbcf-c973-4c32-b54d-06e00aabbf56%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Google App Engine" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/google-appengine/IZgep9t3LbI/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/google-appengine. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/google-appengine/CAEx3o45QqwjZLmu-bMw3VFPED0Vc96puWsjQdNqZ3t4ub0vaCg%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/google-appengine/CAEx3o45QqwjZLmu-bMw3VFPED0Vc96puWsjQdNqZ3t4ub0vaCg%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/658e0110-ecb1-429d-91a7-98383274ff19%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
