Search code examples
google-app-enginegoogle-cloud-sqlcloud-sql-proxy

GAE Cloud-sql-proxy - How to connect to two DB locally?


I try to connect to two different Cloud MySCQL Databases instances for one GAE project. Locally i try to put first to 127.0.0.1:3307, scond to 127.0.0.1:3308.

I execute:

$ C:\\...\cloud_sql_proxy.exe -instances=mypoject:region:first_db=tcp:3307, myproject:region:second-db=tcp:3308

But it seems like run only first_db. The second wont run. MySQL client cant connect to db on port 3308.

Output of previous execution cloud_sql_proxy.exe:

YY/MM/DD HH:MM:SS Listening on
> 127.0.0.1:3307 for mypoject:region:first_db YY/MM/DD HH:MM:SS 
Ready for new connections

What's the problem? Thanks


Solution

  • Based on the documentation.

    You should have run the proxy instances argument without white-spaces.

    ./cloud_sql_proxy -instances=myProject:us-central1:myInstance=tcp:3306,myProject:us-central1:myInstance2=tcp:3307