The default firewall CentOS7 as firewall, and the default is not open.
systemctl start firewalld # start friewall
systemctl status firewalld # View firewall start case
firewall-cmd --zone = public --add-port = 3306 / tcp --permanent # open port 3306
firewalld # firewall-cmd --reload 重启
firewall-cmd --query-port = 3306 / tcp port 3306 to see whether to open