Alibaba Cloud has opened port 3306 and still can't connect? If the database password is entered correctly or not, it is probably the reason why the firewall is turned on! Centos command
systemctl status firewalld Check whether the firewall is activated, as shown in the figure, it is activated!
If it is started, use service firewalld stop.