Mysql – Fail to connect from MySQL Workbench to remote server

MySQLmysql-workbench

After trying many different suggestions as found on the net, I'm still unable to establish a connection from the Workbench application to the server. Here is a brief list of things I tried:

1) Granting all privileges on . to 'root'@'%' ; (+flush privileges),

2) Creating a new user 'test'@'%' and granting all privileges (yes, it is the same as above, but had to try with someone different from root),

3) Create a user as 'test2'@'' with all privileges,

4) Turning off firewall in both server and my computer,

5) Updated the file /etc/my.cfg my adding a bind-address = 0.0.0.0 line (there wasn't any such line, to begin with; note the location of this file which differs from what is presented in many posts; in my installation, there is no such a folder /etc/my.cfg/…),

The error I get is always that cannot establish a connection (with the 4 steps to check; obviously, I checked them all and it should work).

I have Workbench installed on Windows 10 and I'm using the standard MySQL included in the Oracle Linux 7 installation ISO.

Could anyone suggest additional checks to be made and to find what the issue is?

Best Answer

The issue had nothing to do with MySQL parts. It turned out that Linux's firewall and Selinux were blocking access from outside the server. Once turned off, the connection worked perfectly.

Two things I learned from this:

1) Check better the ENVIRONMENT before blaming the product,

2) MySQL could improve the clarity of the messages and include environment elements that could be the source of the issue (I wasted 1/2 day chasing this stupid issue).