“This is the fourth day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021.”

Two days before at the time of set up the mysql database, thought is very simple operation at a time, stepped on a big pit results no problem, first of all we do any operation, set up any service should be open to our port, otherwise blocked requests we are less than in ali cloud security group to add into the direction we want to open ports, I personally do not recommend opening up the firewall, after all, it is the equivalent of streaking; Ali cloud security group configuration is still a fool, we can check the status of the firewall through the following

systemctl status firewalld
Copy the code

After we open may prompt warning, can in the/etc/firewalld firewalld. Search the conf AllowZoneDrifting, it’s yes to no, then open our port

firewall-cmd --zone=public --add-port=3306/tcp --permanent
Copy the code

Here is an example to build mysql; Open our port 3306 and pass through again

firewall-cmd --zone=public --list-ports
Copy the code

Check our port opening status, and finally restart the firewall to make the configuration take effect;

systemctl restart firewalld
Copy the code

If you want to verify the connection, you can use Navicat to check whether the connection is successful. If you want to verify the connection, you need to check whether the mysql installation is successful. If you want to verify the connection, you need to check whether the mysql installation is successful. “IDENTIFIED WITH mysql_native_password” can be IDENTIFIED WITH mysql_native_password, and then refresh to make it effective

flush privileges;
Copy the code

Such a complete production environment mysql building is over open port is very simple, but for many beginners tend to ignore it, just think local open port, but don’t know the security group, also need to finally opened the firewall, security problem, and build a service must set the password, Or something very unexpected will happen to your machine, and at worst you’ll have to reinstall the system,