1. In the CentOS system firewall is blocked by default 3306 port, if we want to access the MySQL database, we need this port, the command is as follows:
/sbin/iptables-i input-p TCP--dport 3036-j ACCEPT
We need to save our operation with the following command:
/etc/rc.d/init.d/iptables Save
At this point we can view the status of the port, with the following command:
/etc/init.d/iptables status
Of course if you open the other ports as well, just transfer the port number to the port number you need.
2. A workaround for modifying permissions for remote connections occurs with 1045 errors:
GRANT all privileges on * * to ' yourusername ' @ '% ' identified by "YourPassword";
This article is from the "Kunka" blog, make sure to keep this source http://kunka.blog.51cto.com/2061950/1574224
Troubleshooting MySQL Remote connection ports and permissions under CentOS