📜  使用 Cloud SQL Auth 代理连接到多个实例 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:19.100000             🧑  作者: Mango

代码示例1
# Start the Cloud SQL Auth proxy to connect to two different Cloud SQL instances    # Give the Cloud SQL Auth proxy a unique port on your machine to use for each Cloud SQL instance.    ./cloud_sql_proxy -instances=myProject:us-central1:myInstance=tcp:5432,myProject:us-central1:myInstance2=tcp:1234    # Connect to "myInstance" using port 5432 on your machine:    psql -U myUser -h 127.0.0.1  --port 5432    # Connect to "myInstance2" using port 1234 on your machine:    psql -U myUser -h 127.0.0.1  --port 1234