【发布时间】:2017-12-13 02:00:47
【问题描述】:
当从 EC2 实例访问 RDS 时显示超时错误
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Connection timed out in
我尝试指定EC2实例的IP地址并指定RDS实例的内部IP但错误相同。
【问题讨论】:
-
能否显示用于从 ec2 连接到 RDS 的连接字符串/url?
-
$this->pdo = new PDO('mysql:host='.$this->host.';port='.$this->port.';dbname='.$this ->数据库,$this->user,$this->passwd);
-
在RDS实例安全组中允许你的ec2 ip在入站规则中,然后先telnet到RDS端口telnet RDS_URL 3306
标签: php amazon-web-services amazon-ec2 amazon-rds