问题
When accessing RDS from an EC2 instance that time show me timeout error
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Connection timed out in
i have try to specifying the IP address of the EC2 instance and specify the internal IP of the RDS instance but error is same.
回答1:
The most probable reason is that your RDS Security Groups are not configured to allow incoming traffic.
You need to change those security groups and allow inbound traffic.
Would recommend that inbound traffic's source IP's be limited to internal IP's of the EC2 instances from which you are hitting the RDS or for the CIDR block of the VPC/Subnet in which your EC2 instances are created.
来源:https://stackoverflow.com/questions/47773330/aws-rds-database-show-timeout-error