Skip to content

Commit 8d8d28d

Browse files
committed
authenticate before starting proxy maybe, idk
1 parent d64e1a5 commit 8d8d28d

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
@@ -11,6 +11,12 @@
1111

1212
To run this application locally, download and install the `cloud_sql_proxy` by following the instructions [here](https://cloud.google.com/sql/docs/mysql/sql-proxy#install).
1313

14+
To authenticate with Cloud SQL, set the `$GOOGLE_APPLICATION_CREDENTIALS` environment variable:
15+
16+
```bash
17+
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account/key.json
18+
```
19+
1420
Once the proxy is ready, use one of the following commands to start the proxy in the background.
1521

1622
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.
@@ -36,7 +42,6 @@ $ ./cloud_sql_proxy \
3642
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.
3743

3844
```bash
39-
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account/key.json
4045
export CLOUD_SQL_CONNECTION_NAME='::'
4146
export DB_USER='my-db-user'
4247
export DB_PASS='my-db-pass'

0 commit comments

Comments
 (0)