Last active
June 2, 2019 06:19
-
-
Save juizmill/43adf073d7b2e0a245bd0a51f7ecea58 to your computer and use it in GitHub Desktop.
Conectar com google SQL via 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
#! /bin/bash | |
while : | |
do | |
read -p "Qual é o nome da conexão: " _CONEXAONAME | |
if [[ $_CONEXAONAME == "" ]]; then | |
echo "O nome da conexão não pode esta em branco!" | |
continue | |
else | |
break | |
fi | |
done | |
SQL_PROXY=$HOME"/cloud_sql_proxy" | |
if [ ! -f $SQL_PROXY ] | |
then | |
wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy | |
chmod +x cloud_sql_proxy | |
fi | |
$SQL_PROXY -instances=$_CONEXAONAME=tcp:3307 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment