Connecting MySQL server on Amazon EC2 instance using ssh tunnel
By Divyen Patel on Dec 27, 2009
SSH tunnel basically does the port forwarding via secure ssh service.
Let's start with launching a latest hardened AMP stack AMI (ami-e0b05389) instance.
Once the instnace is up and running, open the terminal client and connect to the instance using ssh.
Restart ssh service
Comment out skip-networking from /etc/mysql/my.cnf and save the file
Restart MySQL service
exit the ssh connection and recreate ssh connection using following command.
Keep the terminal opened, and start MySQL Query Browser / MySQL administrator from your local machine. and connect to the MySQL server on remote EC2 instance via the port 3307, as shown in the following sanpshots.
When done close the ssh connection and it should close the ssh tunnel.