12

I just wanted to ask if we can access an external MySQL server from Google App Engine...

5
  • previously asked here: stackoverflow.com/questions/1651629/… Commented Jun 15, 2010 at 21:57
  • 1
    @Taylor Leese: I have various reasons to do this including free to start with and almost unlimited scalability. AWS was not an option in my case. Commented Jun 16, 2010 at 12:35
  • Hosted SQL is on the roadmap, though there is no indication of whether it will be mysql compatible. code.google.com/appengine/business/#features so it may be possible to move your database there and have it accessible in the future. Commented Jun 16, 2010 at 12:43
  • karman - I meant why do you want to use an external MySQL DB and not use the App Engine datastore? Commented Jun 16, 2010 at 16:15
  • Note that Google recently released Google Cloud SQL: developers.google.com/cloud-sql Commented Feb 8, 2012 at 13:22

4 Answers 4

9

The only way to communicate with other hosts is by using UrlFetch that only provides HTTP and HTTPS requests.
So, you can't do it out of the box.

Anyway, if you really need to access an external MySQL server database, you should consider to expose it through a Web API (RESTful, Soap web-services for example). In this way your data would be available also via UrlFetch.

Sign up to request clarification or add additional context in comments.

3 Comments

So there is no way to do this??
And there are solutions to proxy mysql access through http interface. So it is not so impossible.
Hello Alex.. You said this is not impossible. Are there some ready-made libraries to make this task easier?
3

I am still in the learning phase of all this, but I am fairly certain you can do this now a few ways:

  • Link Apps Scripts to App Engine and use the JDBC
  • Link it to Google
  • Cloud SQL Store your SQL database on Google Cloud Store
  • Connect Apps Scripts via spreadsheet scripting

"Google Apps Script has the ability to make connections to databases via JDBC with the Jdbc Service. The current support extends to MySQL, Microsoft SQL Server and Oracle. Apps Script makes it easy to connect to databases hosted on Google Cloud SQL, but also works with other cloud hosting platforms and even local databases." https://developers.google.com/apps-script/jdbc

(edited for structure)

Comments

1

It is still not possible to native connect GAE to an external MySQL server the only exception is Googles Cloud SQL. We are using it in our production environment and like the experience. Stable and the performance is good.

GAEs own database scales well and we are using it in most situations, but in cases where we need to ask more complex questions or need aggregate functions, we use Googles Cloud SQl.

Comments

0

These answers are a bit outdated. Google App Engine instances can connect to external database servers.

The ability to connect externally requires that the account the App Engine is running under be a "paid account" a/k/a "billing enabled".

References:

-https://cloud.google.com/appengine/docs/php/using-third-party-databases

-https://cloud.google.com/appengine/docs/php/runtime#PHP_Functions_that_requires_billing_enabled

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.