Forked from humbertodias/gist:3138cf7753b6814d37b606764fb9efaf
Last active
July 10, 2018 20:20
-
-
Save GitHub30/58c3a66787898562c6e3d08221911e80 to your computer and use it in GitHub Desktop.
Exporting Mysql server to internet
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
# port forwarding(-p 3306:3306) required | |
docker run -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password -d mysql:5.7 # play with docker (https://stackoverflow.com/questions/49194719/authentication-plugin-caching-sha2-password-cannot-be-loaded/49944625#49944625#answer-49944625 for mysql8) | |
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | |
unzip ngrok-stable-linux-amd64.zip | |
# tunnel online(free authtoken required) | |
./ngrok tcp 3306 | |
# In local | |
# connection | |
user=root | |
pass=password | |
host=0.tcp.ngrok.io # Please change yours | |
port=16799 # Please change yours | |
mysql -u$user -h$host -P$port -p$pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment