Connecting CloudSQL using App Engine in PHP 7.2

110 views
Skip to first unread message

Brandon Zukowski

unread,
Jan 28, 2020, 10:02:35 AM1/28/20
to Google App Engine
Hi there, we are trying to open a connection to our CloudSQL instance and perform queries using App engine and PHP 7.2, but we keep getting a "get address not found" error. Any help would be appreciated!

Mua Rachmann

unread,
Jan 28, 2020, 10:48:39 AM1/28/20
to google-a...@googlegroups.com
Hi Brandon,

All should be fine if your app.yaml file has the correct credentials. Something like

  DB_CONNECTION: mysql
  DB_HOST: localhost
  DB_DATABASE: xxxxxxxxxx
  DB_USERNAME: xxxxxxx
  DB_PASSWORD: xxxxxxxx
  DB_SOCKET: /cloudsql/<project-id>:<region-here>:<db-instance-name>

And have this also in your app.yaml

beta_settings:
  # for Cloud SQL, set this value to the Cloud SQL connection name,
  cloud_sql_instances: <project-id>:<region-here>:<db-instance-name>

Give these a try and let me know if the error persist. Also ensure you have the instance up and running.

Cheers,
Mua


On Tue, Jan 28, 2020 at 4:02 PM Brandon Zukowski <beaz...@gmail.com> wrote:
Hi there, we are trying to open a connection to our CloudSQL instance and perform queries using App engine and PHP 7.2, but we keep getting a "get address not found" error. Any help would be appreciated!

--
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 google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/7361d228-e5b5-46e8-ad93-4fe29da02c96%40googlegroups.com.


--

MUA N. LAURENT
: Software Engineer

Akwa, Douala,CM 00237 | 174 Royal Rd, Cape Town, WC 7405, SA
Phone: (237) 670-518-086

 

Harmit Rishi (Cloud Platform Support)

unread,
Feb 5, 2020, 8:07:59 PM2/5/20
to Google App Engine
Hello,

Thank you for using Google Groups!

Depending on your environment, you may consult our step by step guides provided on our Github page for both our standard and flexible environments when connecting from Google App Engine(PHP) to a Cloud SQL instance. In addition to this, you may also refer to the appropriate app.yaml file examples included there for further insight into the parameters being discussed on this thread. 

I hope this helps!

Emanuel Allen

unread,
Mar 16, 2020, 7:35:48 AM3/16/20
to Google App Engine
dam... why is this so hard, i'm struggling with trying to get my app engine to connect to google cloud mysql... it shouldn't be this hard to do! it really shouldn't be... google should have examples after examples after examples of this to help us out. it shouldn't be this hard.

Mua Rachmann

unread,
Mar 16, 2020, 7:47:10 AM3/16/20
to google-a...@googlegroups.com
Hi Emanuel,

The documentation has the steps clearly stated. Please check that you are doing the correct thing and actually your environment variables
are being actually set and passed correctly to perform the connection.

If you need help. Feel free to ask.

Regards,
Mua

--
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 google-appengi...@googlegroups.com.


--

MUA N. LAURENT
: Lead Software Engineer

Emanuel Allen

unread,
Mar 17, 2020, 12:59:29 PM3/17/20
to Google App Engine
how about you do it for me cause this is crazy how hard it is... people telling me to go with a paid server to make it easier to do a simple server to play around with and i'm starting to think the same to just give up and go with a paid server out the gate. i'll give you my log in information and you can do this for me. or you can do it for me through team view. idk what i'm doing wrong.


On Tuesday, January 28, 2020 at 10:02:35 AM UTC-5, Brandon Zukowski wrote:
Reply all
Reply to author
Forward
0 new messages