Trying to use MySQL Workbench with TCP/IP over SSH - failed to connect
I stumbled upon this question when I myself had encountered this error. I could finally figure out the configuration.


I didn't touch anything in /etc/mysql/my.cnf which already has bind_address = 127.0.0.1. So only localhost can connect.
I use OpenSSH server. So in its config file /etc/ssh/sshd_config I changed from no to yes the param responsible for TCP forwarding, thus AllowTcpForwarding yes.
Finally I have the following entered in MySQL WorkBench.


SSH Hostname: 192.168.0.8:22 (my SSH server listens to port 22)
SSH Username: sshuser
SSH Key File: *C:\Users\windowsuser\.ssh\id_rsa* (should be private key, even though it says public)
MySQL Hostname: 127.0.0.1 (this should not be changed, since MySQL server by default is bound to localhost only which I didn't change)
MySQL Server Port: 3306 (also default)
Username: root



The only remaining thing for you is to configure correctly your SSH server to work with keys rather than passwords. Hope this will help someone.