Last active
August 16, 2018 20:37
-
-
Save greglamb/d0dd35aaf1baffffa629077520a2c4ba to your computer and use it in GitHub Desktop.
remotemyadmin.sh sshuser@host.com mysqluser mysqlpassword
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 | |
if [ $# != 3 ] | |
then | |
echo "remotemyadmin.sh sshuser@remotehost.com mysqluser mysqlpassword" | |
exit | |
fi | |
docker pull phpmyadmin/phpmyadmin | |
docker run --name remotemyadmin -d -e PMA_HOST=docker.for.mac.localhost -e PMA_PORT=13306 -e PMA_USER=$2 -e PMA_PASSWORD=$3 -p 18080:80 phpmyadmin/phpmyadmin | |
echo | |
echo starting up - refresh browser if necessary | |
echo hit Ctrl-C to quit | |
echo | |
(sleep 3 && open http://localhost:18080)& | |
ssh $1 -L 13306:127.0.0.1:3306 -N | |
docker rm -f remotemyadmin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment