Published on

Connect Remote MySQL Database Through SSH Tunneling

Start SSH Tunnel

ssh -N -L 3307:$DB_URL -i /path/to/pem user@base -oHostKeyAlgorithms=+ssh-rsa -o 'PubkeyAcceptedKeyTypes +ssh-rsa'

Connect from local machine

mysql -u remote_db_user -h 127.0.0.1 -P 3307 -p