Google App Engine API - Failed to Load Databases - Cloud SQL - mysql

I have a Google App Engine PHP website with MySQL database.
The website works and the database works correctly. I have connected the database instance to the application and I can access MySQL Client (and can perform queries).
But when I access the Google Cloud SQL API via the Google App Engine Developers Console (on the google developer console website) the database fails to load.
For example:
I select the correct application/database instance. I go on 'Google Cloud SQL' API and then 'SQL Prompts' but get:
Failed to load databases.
Any reasons as to why this is happening? and how to load the database? or why won't the database load in the first place?

Are you trying to access the link [1] to load your database in your browser.If yes then might be its a browser issue or multiple login problem.
[1] https://console.developers.google.com/project/app-id/sql/instances

Related

Can Flutterflow app access MySQL database from my Google Cloud Instance?

I will create a mobile app for Android and iOS. The purpose of the app is to access just a segment of the MySQL database, that part is for customers (the rest of the database is used by employees via my web application).
Is there a way the for FlutterFlow app to access MySQL database instead of FireBase Storage? If not, what are the alternatives?
Though flutterflow has default integration with Firebase firestore database,
below 2 approaches can be used.
API integration approach can be used to use MYSQL database.
Please refer below flow:
You can have backend Server which will host the API.
This backend server will have integration with MYSQL DB
API's will be consumed in flutterflow app
https://docs.flutterflow.io/data-and-backend/api-calls
Custom code approach (Though have not used it before)
https://docs.flutterflow.io/customizing-your-app/manage-custom-code-in-github

API Base URL for Google Cloud SQL

I am trying to integrate Google Cloud SQL for Mysql into another application. The other application wants the "api base url". Does anyone know how to get the "api base url" of Google Cloud SQL for Mysql?
If you are using Google Cloud SQL and you are trying to connect your external application this documentation is the best for your case. In that document discuss the summary of connection options, authorization options and code samples also the tools for connecting that will help you to connect in Cloud SQL Mysql instance.
If you are referring to the reference of REST APIs of Cloud SQL and its service-endpoint(https://www.googleapis.com), these are some examples:
Method
Format
Description
delete
DELETE /sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}
Deletes a database from a Cloud SQL instance.
get
GET /sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}
Retrieves a resource containing information about a database inside a Cloud SQL instance.
insert
POST /sql/v1beta4/projects/{project}/instances/{instance}/databases
Inserts a resource containing information about a database inside a Cloud SQL instance.
update
PUT /sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}
Updates a resource containing information about a database inside a Cloud SQL instance.
NOTE: You need to enable the Cloud SQL Admin API before using it.

Cannot access Google Cloud SQL database from my App Engine

Last week I tried to setup Google Cloud for a NodeJS API and Cloud SQL database. Overall it works fine, but I can't access my Cloud SQL database. The authorization of the SQL database shows that all apps within the current project are granted to access the database. Unfortunality, this is not true. I need to granted the IP addresses of the instances from the App Engine. The IP adressess of the instances constantly changes after I deploy a newer version of the the API.
Does anybody have a solution to get access from the App Engine to the Cloud SQL database. It's very annoying to add constant the instance ip address to grant the database.
Sample here
Thank you in advance!
Jelle
I was going to suggest to assign a static IP to the app engine, but seems like it's not possible in App engine (it's possible in compute engine though). So lets tackle the root of the problem, you being unable to access cloud sql from App engine, are you sure you followed the instructions of the following link to the letter?
https://cloud.google.com/nodejs/getting-started/using-cloud-sql
This might solve your connection issue if you haven't.

google app engine denying google sql connection

I am trying to connect my web application to google sql. The app is running and getting deployed on appspot without database access. However when I try to deploy enable google cloud sql it is giving me following error:
I am to access the cloud sql using mysql command line prompt. Can anybody help what am I doing wrong here. I think there is a problem with appid. I create an application name cfsdonuts on appengine and gave it the access to sql instance. I create the application on eclipse with same appid (because eclipse was not allowing to choose from existing id's not it was allowing me to create new app id at the time of project creation. When I deploy the application on app engine the name comes as http://1-dot-cfsdonuts.appspot.com/. Should I use this name?

App Engine and MySQL

I just wanted to ask if we can access an external MySQL server from Google App Engine...
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.
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)
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.
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