Your solution works indeed if I run the application locally on my computer
Ooh, maybe I did not fully understand the issue here then
You want to run your development agent in a GCP environment? If that’s the case, you may want to use a private cloud network, and allow it to both your app & your cloud SQL instance.
GCP would then give you a private network URL to connect your app to your cloud SQL instance with a simple connection string (It seems to be detailed in this section) without the need of a socket file to open the connection.