Page 1 of 1

Accessing a Google Cloud mySQL DB

Posted: Tue Dec 03, 2019 2:26 am
by simon.schvartzman
Hi fellows, I was able to successfully run a simple CRUD App connected to a mySQL DB hosted on Google Cloud. To be able to connect to the DB I had to define the IP address of my workstation as an "Authorized Network" in the DB Connection Configuration.

Now I want to be able to be able to connect from "any network" (a LC app running on a mobile) and in order to do so (according to the Google Cloud documentation) I had to use a Proxy which seems a rather complicated (for me) process and therefore I wonder if any of the experienced developers in the forum has done this and is willing to share the recipe...or at least give some hints (besides the GC documentation)

Many thanks in advance

Re: Accessing a Google Cloud mySQL DB

Posted: Tue Dec 03, 2019 3:20 am
by FourthWorld
Do they offer a REST API?

Re: Accessing a Google Cloud mySQL DB

Posted: Tue Dec 03, 2019 11:20 am
by simon.schvartzman
Hi Richard, thanks for jumping in. Could you please tell what is your idea?

I'm not sure if there is such option but in searching for the answer to your question I found this article "Authenticating users with PHP" ( ... cate-users) which I guess points out in the same direction. I will explore this option further because it seems very interesting (even though it is billable...)

EDITED: it seems this solution wouldn't work a LC mobile app because according to Google Documentation
However, this can only be used for computing services that support Cloud IAP, such as App Engine and load balancers. You cannot use Cloud IAP on a local development machine.
So I'm back to the starting point

Re: Accessing a Google Cloud mySQL DB

Posted: Tue Dec 03, 2019 9:01 pm
by FourthWorld
It's very rare that we'd want to expose the full power of MySQL to the open Internet. More commonly, the DB is protected from the Internet by an API accessed over HTTP, often using REST style. Depending on the cloud service, an API may be provided. Or they may expect you to provide your own, which would be written in PHP, Python, Perl, or just about any other general purpose scripting language commonly used on the web - even LiveCode Server.

This would explain why they require entering specific IP addresses to be able to touch the DB. Those are assumed to be administrators.

So the question is: What interface does Google provide for public access to its MySQL containers? If not HTTP-based, what is it?

Re: Accessing a Google Cloud mySQL DB

Posted: Tue Dec 03, 2019 9:57 pm
by simon.schvartzman
Hi Richard, in this article ... on-methods all the options are explained.

All of them are too complicated for me, and I guess are very complicated as well to any "normal" LC developer trying to get the most out of the easy of use and power of LC together with a standard SQL DB.

In my case using LC Hosting is not a good option (beside the extra $$$) because as there is no Data Server in my region (Brazil) I'm afraid performance will be impacted. That's why I was thinking on Google Cloud because they do have a huge Data Server locally.

Still looking for alternatives...

Many thanks for taking your time to answer