Skip to content

Instantly share code, notes, and snippets.

@juizmill
Last active June 2, 2019 06:19
Show Gist options
  • Save juizmill/43adf073d7b2e0a245bd0a51f7ecea58 to your computer and use it in GitHub Desktop.
Save juizmill/43adf073d7b2e0a245bd0a51f7ecea58 to your computer and use it in GitHub Desktop.
Conectar com google SQL via proxy
#! /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