AWS EC host can not connect RDS MySQL with PHP

Problem Description

solution

First, confirm their security group permissions

You need to configure security group permissions for your database in the RDS, that 3306ports need to be open to the host EC:

SG

Among them, select the type MYSQL/Aurora, so you can open the 3306port, the source is defined as my host IP and EC where security group. (Just type the host name, AWS can automatically adapt)

Second, turn off the security-enhanced Linux (SELinux)

AWS EC SELinux is enabled by default so that the server can not access external MySQL PHP culprit. Use rootthe user to modify the host EC /etc/selinux/configdocument:

1
SELinux = disabled

EC reboot the host, re-open the httpd service can be.

Original link large column  https://www.dazhuanlan.com/2019/08/15/5d551400cb323/

Guess you like

Origin www.cnblogs.com/chinatrump/p/11416251.html