Skip to content

Instantly share code, notes, and snippets.

@mthri
Created December 15, 2021 08:52
Show Gist options
  • Save mthri/2fe72728d6e8d85bd9d2ed48c4067768 to your computer and use it in GitHub Desktop.
Save mthri/2fe72728d6e8d85bd9d2ed48c4067768 to your computer and use it in GitHub Desktop.
Create an SSH Tunnel on Linux and Connect to MySQL
ssh -p 22 -N -L 3306:127.0.0.1:3306 [USER]@[SERVER-IP]
# -p -> ssh port
mysql -u [MYSQL-USER] -p -h 127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment