App Engine, MySQL and private ip

80 views
Skip to first unread message

Charlotte Hyldahl

unread,
Dec 4, 2019, 5:05:34 PM12/4/19
to Google App Engine
Hi,

I have an PHP application that can only connect through TCP to mysql (no sockets). I host it on Google Cloud App Engine. I have created a Cloud SQL database too.

When i use the PHP application externally, it connects fine to the public ip of my Cloud SQL database. I have allowed my external ip in the connection panel of the Cloud SQL database. All is fine.

But now when i deploy the PHP app to app engine it fails, thats pretty obvious, as i use the public ip, and the new ip is not allowed in the Cloud SQL database.

My question is: How do i get an internal ip address that i can use to connect to my Cloud SQL database from my PHP app on App Engine?

Sorry but i really cant find a good answer for this pretty simple question.

Regards Charlotte

Elliott (Cloud Platform Support)

unread,
Dec 4, 2019, 6:32:12 PM12/4/19
to Google App Engine
Hello Charlotte,

You can get a private IP when you create a Cloud SQL instance under “Configuration Options”. I hope this helps.

Andrew Gorcester

unread,
Dec 4, 2019, 6:37:33 PM12/4/19
to google-a...@googlegroups.com
Hi Charlotte,

Additionally, once you have a private Cloud SQL IP address, I think you should be able to connect to it from App Engine by using Serverless Virtual Private Cloud Access: https://cloud.google.com/vpc/docs/configure-serverless-vpc-access .

On Wed, Dec 4, 2019 at 3:32 PM 'Elliott (Cloud Platform Support)' via Google App Engine <google-a...@googlegroups.com> wrote:
Hello Charlotte,

You can get a private IP when you create a Cloud SQL instance under “Configuration Options”. I hope this helps.

--
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/58f84428-a784-4f58-8aea-c739eaad316b%40googlegroups.com.

Charlotte Hyldahl

unread,
Dec 5, 2019, 4:12:12 PM12/5/19
to google-a...@googlegroups.com
Hi again

I tried with some VPC connector, but i am not sure i get it.

Just to clarify, this is the only thing i want:
. Create a mysql database on Google Cloud
- Create an App Engine with Php 7.2
- Connect som php code to the mysql database over tcp port 3306

As i wrote everything works with the public ip of the mysql, if i run the php code from an external server. But as soon as the php code is running on the App Engine, it cant connect. Neither on the public ip or the private ip. I think you are right, need some VPC connector, but i dont get how to connect it properly.

Is this really that complicated for such a simple task? Or do i miss something?

Regards Charlotte




--
Charlotte Hyldahl
Branddamsvej 2, Over Fussing
8920 Randers NV
charlott...@overfussing.dk

Elliott (Cloud Platform Support)

unread,
Dec 6, 2019, 5:28:20 PM12/6/19
to Google App Engine
Hello Charlotte,

I don’t think this is the correct forum to get the help you need. Google Groups is intended for general discussions about Google Cloud products and to share opinions.

The Stackoverflow forum would be the best option to get help with technical information.

I hope this helps.

Reply all
Reply to author
Forward
0 new messages