Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jzonthemtn/cloud-sql-auth-proxy-scripts
Convenience scripts for Google Cloud SQL Auth Proxy
https://github.com/jzonthemtn/cloud-sql-auth-proxy-scripts
Last synced: 24 days ago
JSON representation
Convenience scripts for Google Cloud SQL Auth Proxy
- Host: GitHub
- URL: https://github.com/jzonthemtn/cloud-sql-auth-proxy-scripts
- Owner: jzonthemtn
- License: mit
- Created: 2024-02-12T21:14:23.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-13T18:54:11.000Z (9 months ago)
- Last Synced: 2024-04-27T00:16:27.592Z (6 months ago)
- Language: Shell
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Google Cloud SQL Auth Proxy Scripts
This is a set of convenience scripts for accessing Google Cloud Cloud SQL databases using the [Google Cloud SQL Auth Proxy](https://cloud.google.com/sql/docs/mysql/sql-proxy).
## Connecting
To get started clone this repository and `cd` into the directory.
```
git clone https://github.com/jzonthemtn/cloud-sql-auth-proxy-scripts.git
cd cloud-sql-auth-proxy-scripts
```Now, run the `download-proxies.sh` script to download the Cloud SQL Auth Proxy binaries.
Next, log in to Google Cloud if you have not already:
```bash
gcloud auth login
gcloud auth application-default login
```Next, edit the `database.properties` file to set your environment settings.
Now, run the connection script for your operating system and the database you want to connect to. (This starts the Cloud SQL Auth Proxy.) For example, to connect to the stage database, run:
```
./connect_stage_linux_x64.sh
```Lastly, using your favorite database client, connect to `localhost` on the port specified in the `database.properties`. Your username is your Google Cloud user name (whatever is in front of the @ in your email address.)
*There is no password so leave any password prompts blank!*
An example for connecting to a Google Cloud CLoud SQL MySQL database via the Cloud SQL Auth Proxy:
```bash
mysql --host localhost --port=3306 --user=jzonthemtn
```You are now connected to the database!