Created
May 8, 2010 18:01
-
-
Save ecarter/394684 to your computer and use it in GitHub Desktop.
Quick SSH tunnel for mysql connections for when you don't feel like add specific remote host access
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
### Quick SSH tunnel for mysql connection ### | |
# 3307 = local port to use | |
# mysqlserver = name/ip of mysql server | |
# 3306 = port number for remote mysql | |
# user@gateway = server you want to tunnel through | |
ssh -L 3307:mysqlserver:3306 user@gateway | |
# Now you can access remote mysql server locally by going to localhost | |
mysql -u user -p -h 127.0.0.1 -P 3307 dbname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment