SSH Port Forwarding Tunnelling

USED FOR MYSQL

https://stackoverflow.com/questions/25495364/laravel-mysql-db-connection-with-ssh/41698783#41698783

ssh -i id_rsa -N -L 13306:REMOTE_DATABASE_HOST:3306 pshridhar@INTERMEDIATE_SERVER_IP

13306 port will be mapped to remote server port 3306

User 13306 to connect to server 3306 remote port

User localhost or 127.0.0.1 as db host name

pshridhar is user of remote intermediate server , it can be removed if we can directly connect to server

“/Applications/MySQLWorkbench.app/Contents/MacOS/mysql” “-uDATABASE_USER” “-h127.0.0.1” -P13307 –pDBPASSWORD DATABASENAME