I've got ~50 databases all set up at different host names, with the requirement that I connect to them through an SSH tunnel.
For example:
I have managed to create the tunnel using autossh (web server running Debian), but I can't seem to figure out how to connect to a specific MySQL hostname "beyond" the SSH tunnel.
Typing lsof -i -n | egrep '<ssh>'
confirms that the tunnel is working (sends port 3307 to ssh.example.com port 3306)
So when I try mysql -h 127.0.0.1 -P 3307
I get Connection refused. Not too weird since it's not an MySQL server.
My question to you guys:
How do I specify the mysql1.example.com
host AFTER creating the SSH tunnel? I've tried searching everywhere but can't seem to figure it out.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…