I have a MySQL database server with bind-address
set to 10.x.y.z (IMPORTANT: not listening on localhost etc)
The web nodes can connect and use MySQL no problem.
Now I’m trying to access MySQL from my local machine.
First set up a tunnel with:
ssh -N -L 3306:10.x.y.z:3306 user@dbserver
Now try mysql:
mysql -h 10.x.y.z -u dbuser -p
It hangs for a long time and finally returns with “Can’t connect to MySQL server on ’10.x.y.z:3306′ (110)”.
If I SSH into the server, I can connect to mysql just fine. Either with
mysql -u dbuser -p
or with
mysql -h 10.x.y.z -u dbuser -p
I have also confirmed that /etc/ssh/sshd_config
has
AllowTcpForwarding
set to yes
.
What am I doing wrong with the tunnel part?
1
Because you NEED to ssh to get the permission to start MySQL
WetNaybor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.