Issue
I deployed an Ubuntu VM in a private subnet and installed MySQL on it. I also have a jump VM which I use to connect to the MySQL server. But now I need to access the MySQL server from my WorkBench. MySQL server port 3306 is opened for 0.0.0.0/0
I created a new connection in WorkBench and selected 'Standard TCP/IP over SSH' as the connection method, and the Public IP address of the Jump VM as the 'SSH Hostname', 'ec2-user' as the 'SSH Username', the .ppk file for the 'SSH Key File', private IP address of the MySQL VM in the private subnet as the 'MySQL Hostname', '3306' as the 'MySQL Server Port' and 'root' as the 'Username'.
But it gives the below error
'failed to connect mysql at <MySQL-EC2-Private-IP> with user root through ssh tunnel at ec2-user@<public-ip-of-jump-vm with user root'
Solution
I found the issue. You have to change the IP address which is localhost by default to accept traffic from anywhere in below path (Change 127.0.0.1 to 0.0.0.0)
/etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 0.0.0.0
mysqlx-bind-address = 0.0.0.0
Answered By - Container-Man Answer Checked By - Terry (WPSolving Volunteer)