google app engine connect to external database

65 views
Skip to first unread message

Luciano Lopes

unread,
Aug 2, 2021, 9:44:23 AM8/2/21
to Google App Engine
Hello people. I have two Java projects running on AppEngine, one of the projects has a MySQL instance and is already connected to AppEngine. I would like both projects to connect to the same database. I've already activated the Cloud SQL APIs, Cloud SQL Admin even so it didn't work, I'm getting the following error:

{
     "code": 403,
     "errors": [
         {
             "domain": "global",
             "message": "The client is not authorized to make this request.",
             "reason": "notAuthorized"
         }
     ],
     "message": "The client is not authorized to make this request."
}

can you help me?

Pablo Lopez

unread,
Aug 20, 2021, 1:08:11 PM8/20/21
to Google App Engine
Try this:

Go into the iam-admin for the project  you want to give access to the DB and look for the service account it would be something like [project_id]@appspot.gserviceaccount.com, copy it, then in the same page, change the project to the one that hast the MySQL instance and clic Add+ and give the service account the Cloud SQL Client role. 

Cheers

Reply all
Reply to author
Forward
0 new messages