Created
April 4, 2020 20:19
-
-
Save dimaKudr/e4d876e0e32a3a84883a1cd0ce495c20 to your computer and use it in GitHub Desktop.
cloud sql proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install psql | |
brew install libpq | |
ln -s /usr/local/Cellar/libpq/12.2_1/bin/psql /usr/local/bin/psql | |
# Mac: install cloud sql proxy | |
curl -o cloud_sql_proxy https://dl.google.com/cloudsql/cloud_sql_proxy.darwin.amd64 | |
chmod +x cloud_sql_proxy | |
# start proxy | |
# INSTANCE_NAME example - kuber-test-02:us-central1:dev-server | |
# | |
./cloud_sql_proxy -instances=<INSTANCE_NAME>=tcp:5432 | |
# when proxy started, connect to DB | |
psql --host=localhost --port=5432 --username=postgres | |
# list databases ('\l' command inpostgres) | |
\l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment