MySQL was installed on Ubuntu 22.04 server per instructions on


  • I am able to SSH into the server and then login into mySQL as root.

The goal is to connect MySQL (MacOS) to MySQL: both server and Mac are on the same LAN.

enter image description here

"Test Connection" returns:

enter image description here


How to diagnose the reason(s) for the error message?

Is workbench configured to not use SSH by using port 3306? Why is it trying SSH port 22? Is there a list of diagnostics that can be performed, so as to ensure that the workbench connects?

1 Answer 1


Reference: https://tecadmin.net/mysql-allow-remote-connections/#

KEY FACT: By default, MySQL is configured to listen on the localhost (, which means that (initially) it can only be accessed from the same machine it is installed on. For remote access (MySQL workbench) MySQL must be configured to on other interfaces.

To configure 22.04 to listen from other interfaces: configure MySQL to bind to all interfaces (listen to In Ubuntu:

sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf

set: bind-address =

reboot mysql service:

systemctl restart mysql.service  #restart

Verify with netstat:

sudo netstat -tulpn  | grep -e "" -e "mysql"

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.