4

I try to open a connection with my MySql DB from my python script. The DB is a MySql 8 instance running on Google Cloud.

For that, I use the Cloud SQL Proxy from Google Cloud.

I correctly created my service account and everything is working perfectly on my Ubuntu laptop. The Unix Socket is created when I execute this command :

./cloud_sql_proxy -dir=/cloudsql -instances=my_connection_name -credential_file=path_to_cred_file

And I can open my connection with my python script.

The problem is when I try to do the same with my Macbook Pro under Mac OSX Catalina : Since the "/" folder is now read only, I created the "cloudsql" folder under : /Users/myname/cloudsql and gave it all the permissions needed.

But, when I execute that script : ./cloud_sql_proxy -dir=/Users/myname/cloudsql -instances=my_connection_name -credential_file=path_to_cred_file

The proxy is running fine except it doesn't create the Unix Socket in the folder

It's then impossible to connect to the db since the socket doesn't exist.

Is there a workaround on Catalina or is it an other problem ?

FairPluto
  • 697
  • 6
  • 28
  • 2
    Does the following [link](https://github.com/GoogleCloudPlatform/cloudsql-proxy#example-invocations) helps? Notice that you can set an absolute path to override `-dir` by using `./cloud_sql_proxy -dir=/cloudsql -instances=my-project:my-region:sql-ins-namet=unix:/my/custom/sql-socket & mysql -u root -S /my/custom/sql-socket`. – Daniel Ocando Nov 05 '20 at 14:04
  • @Agudolive did you manage to fix your issue? – kYuZz May 23 '22 at 21:34

0 Answers0