socketPath: `/cloudsql/${process.env.CLOUD_SQL_CONNECTION_NAME}`
format.
I tried and struggle with this but refuse to fail, can anyone give me a solution to this?
Hello Emanuel,
Even though it requires project ids and Cloud SQL instance name to investigate the issue further, on a best effort basis I have done some research.
If I have understood it correctly you have MySQL database at projectA and App Engine application at projectB.
In that case I believe you have not done the permission part correctly as described by third party in this StackOverflow thread. As described at the StackOverflow thread, you need to go to the Cloud SQL Console and Click Edit. After that you need to select “Connections” from the left menu and need to add the Project where App Engine application is located following the instructions outlined at Console. In this case the Project is projectB.
So after going to projectB, you need to select the App Engine default service account which will be “proj...@appspot.gserviceaccount.com”. After that you need to add the “proj...@appspot.gserviceaccount.com” at projectA with the role “Cloud SQL Client” as described at the StackOverflow thread.
In addition to that in this StackOverflow thread, it is suggested by a third party to enable both Cloud SQL API and the Cloud SQL Admin API in both projects.
If still the issue is not resolved or If you have any technical queries or think your issue is related to code, you can post at the Stack Overflow or Server Fault and a community of developers will assist you.
In case there are any technical issues or you would like to request any feature you can report it at the Public Issues by selecting the right component here.
INSTANCE_CONNECTION_NAME for the instance
on the Instance details page. It uses the format
PROJECT_ID:REGION:INSTANCE_ID,
and is used to identify the Cloud SQL instance you are connecting
to.
service-PROJECT_NUMBER@gae-api-prod.google.com.iam.gserviceaccount.comWhen connecting resources in two different projects, make sure that both projects have enabled the correct IAM roles and have given the service account the correct permissions.
Ensure that the service account for your service has one of the following IAM roles:

.png?part=0.3&view=1)

Hello Emanuel,
Thank you for the screenshot you provided. However, troubleshooting the specific issue might require more detailed information and investigation into your project. Is it possible for you to report the issue through the link in order to get further support on the issue, which would enable the sharing of sensitive information about your project as well as make it much easier to locate the root cause of the error? We will be more than happy to assist you. Thank you for your consideration.