to acess remote mysql on ec2 as local on port 3307 using ssh tunneling we can use following command(assuming port is close on remote machine),
ssh -i
-L 3307:localhost:3306 username@server
This command can be used to acces any other kind of service by changing port number