Skip to content

Commit d5f009f

Browse files
committed
add note on setting connection name
1 parent 7cf5961 commit d5f009f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cloud_sql/mysql/pdo/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ To authenticate with Cloud SQL, set the `$GOOGLE_APPLICATION_CREDENTIALS` enviro
1717
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account/key.json
1818
```
1919

20+
To run the Cloud SQL proxy, you need to set the instance connection name. See the instructions [here](https://cloud.google.com/sql/docs/mysql/quickstart-proxy-test#get_the_instance_connection_name) for finding the instance connection name.
21+
22+
```bash
23+
export CLOUD_SQL_CONNECTION_NAME='::'
24+
```
25+
2026
Once the proxy is ready, use one of the following commands to start the proxy in the background.
2127

2228
You may connect to your instance via either unix sockets or TCP. To connect using a socket, you must provide the `-dir` option when starting the proxy. To connect via TCP, you must provide a port as part of the instance name. Both are demonstrated below.
@@ -43,7 +49,6 @@ $ ./cloud_sql_proxy \
4349
Set the required environment variables for your connection to Cloud SQL. If you are using TCP mode as described above, do not set the `CLOUD_SQL_CONNECTION_NAME` variable.
4450

4551
```bash
46-
export CLOUD_SQL_CONNECTION_NAME='::'
4752
export DB_USER='my-db-user'
4853
export DB_PASS='my-db-pass'
4954
export DB_NAME='my-db-name'

0 commit comments

Comments
 (0)