I am trying to use an SSH tunnel to provide access from my server to the MySQL database on my home server, without using port forwarding on my home router. In other words, I want to run the MySQL server, and establish the SSH tunnel from my home server, and then be able to use the mysql client from the external server. But I keep getting:
bind: Address already in use
I run the mysql server:
service mysql start
and then describe the ssh tunnel:
ssh root@hf2.tr8.us -L 3306:127.0.0.1:3306 -N
or:
ssh root@hf2.tr8.us -L 3306:hf2.tr8.us:3306 -N
Both produce the address in use error. If I create the tunnel first, MySQL refuses to start.
How do I specify the SSH tunnel from the same server that I started MySQL?