'DataGrid com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

create user 'root'@'%' identified with mysql_native_password by '123456'; #create a user root that can be connected by any server

grant all on *.* to 'root'@'%'; #grant all privileges to root

However, when I logged on DataGrid, Communications link failure keeps popping up. Then, I ran telnet ip_address 3306. It did work.

Finally, there is a solution. Maybe, the firewall had stopped me from connecting mysql. So, I ran iptables -F. And then, I could connect it. Hooray!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source