4
votes
  1. Google Cloud SQL: after an upgrade SQL from the first generation to second MySQL workbench can’t connect my instance in Cloud. Why? Maybe you need to do instance 5.7 ?

  2. Google application Engine: after upgrade SQL from the first generation to second MySQL opening a new WEB application and connect to my project in Cloud, it can’t see my instance. Why?

1
Can you provide more details about your use case / setup ? From where you're trying to connect to your SQL instance (inside / outside of GCP) ? What kind of error you're getting (provide some logs if you can - that helps a lot). - Wojtek_B
And - have you read about upgrading from gen 1 > gen 2 and app engine connectivity ? cloud.google.com/sql/docs/mysql/… - Wojtek_B
The first is solved. We created an instance in Cloud SQL 5.7 and database is working. The second problem is that GAE application is not able to connect the second generation of Cloud SQL. Probably I have to rewrite my application. It is still possible to use GWT/GAE tools? - user2258777
In the project properties I have to change the name of instance.This gives a message:Could not connect to Profile (northwestwild.GoogleCloudSQL.DevInstance). Error creating SQL Model Connection connection to Profile (northwestwild.GoogleCloudSQL.DevInstance). (Error: com.mysql.jdbc.Driver) com.mysql.jdbc.Driver Error creating Google Cloud SQL Connection factory connection to Profile (northwestwild.GoogleCloudSQL.DevInstance). (Error: com.mysql.jdbc.Driver) com.mysql.jdbc.Driver - user2258777
I'm not certain about the second part - what you're exactly doing; are you changing the name of the sql instance and then you can't connect from your app (from app engine) ? Can you clarify ? - Wojtek_B

1 Answers

4
votes

Any of these three configurations might eventually prevent the connection from GAE:


a) If you haven't assigned any public IP address to the instance;

the only option to connect would be: Configuring Serverless VPC Access.


b) Confirm and complete the upgrade reads:

If your applications are connecting using the First Generation instance connection name:

<project_id>:<instance_id>

update them to use the Second Generation instance connection name:

<project_id>:<region>:<instance_id>

c) Another possible culprit would be the service-account used - and it's assigned roles:

App Engine uses a service account to authorize your connections to Cloud SQL. This service account must have the correct IAM permissions to successfully connect. Unless otherwise configured, the default service account is in the format service-PROJECT_NUMBER@gae-api-prod.google.com.iam.gserviceaccount.com.


Authorization with authorized networks is usually not required when connecting from GAE.