Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GitHub30/58c3a66787898562c6e3d08221911e80 to your computer and use it in GitHub Desktop.
Save GitHub30/58c3a66787898562c6e3d08221911e80 to your computer and use it in GitHub Desktop.
Exporting Mysql server to internet
# 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