MySQL connection via SSH tunnel
Solution 1:
It appears you have swapped the local address and the remote server address around. For example this site explains it should be:
- Create an SSH tunnel from you client to the server:
ssh -g -L 3307:server-ip:3306 user@server-ip
Now port 3306 of the server is exposed on 3307 on the client. - On the client connect MySQL to the 3307 port:
mysql -u user -p -h 127.0.01 -P 3307
Note that you have to connect to the local loopback address127.0.0.1
as the SSH tunnel already forwarded the connection to the client.