问题
I tried to connect AppMaker to an existing Google SQL database without success. In Google Cloud, I created a second generation instance (europe-west1) and allow every IP (for the test). Next, I created a user, connected Workbench with the database and created a schema. Without problems. In AppMaker I use the following address to connect to the database:
[domainName:]myprojectID:regionName:myinstanceID/mydatabase (with and without domain)
Feedback:
Unable to connect to Google Cloud SQL instance. The Google Cloud SQL address may be incorrect or this App Maker editor may not have permission to access the database. You can find more information about using Google Cloud SQL in our documentation.
How can I connect to Google SQL with AppMaker?
Thanks.
回答1:
The process I followed to connect to the database is the following:
- Create a second generation instance by following the steps here (Please make sure to follow the steps only for "Create a Cloud SQL instance" and then create a database inside that instance)
- Now, go to the IAM & ADMIN section of your project. Click on the blue "add" member option on the top. Type "appmaker-maestro@appspot.gserviceaccount.com" on the "Members" field and from the "Roles" dropdown select Project->Editor
- Return to your second generation SQL instance and copy the value of the Instance connection name property of your instance. Example:
- Follow the steps for second generation found here to connect to the database from AppMaker and when asked for the instance address, type the value you copied on the previous step and add /yourdatabase at the end of it. For example: my-foto-app:us-central1:myinstance/userphotodatabase
- You should now be asked to enter the user and password. Do so and you are finished.
Please note that I haven't tested out this with a europe location but only on a us central location. I hope this helps and works!
回答2:
Second generation instances are not yet supported by App Maker, switch to first generation and it will work.
回答3:
FYI, 2nd gen Cloud SQL is supported bv App Maker and has been for awhile. As of today, Postgre is not yet supported.
来源:https://stackoverflow.com/questions/41679881/connect-appmaker-to-google-sql