无法连接到AWS RDS MySQL实例

时间:2019-08-27 13:50:18

标签: mysql amazon-web-services amazon-rds aws-security-group

我无法连接到AWS RDS MySQL的新实例

$apiKey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$title = 'Title'; 
$message = 'hello message';
$notification =[ 
                    "text" => "Test",
                    'badge' => "1",
                    'sound' => 'shutter.mp3',
                    "android_channel_id"=>"test01",
                    'body'=>$message,
                    'icon'=>'notif_icn',
                    'title'=>$title,
                    'priority'=>'high',
                    'vibrate'=> 1,
                    'alert'=> $message
                ];

$msg = [
            'message'=> $message,
            'title'=> $title
        ];

$fields =[
            "content_available" => true,
            "priority" => "high",
            'registration_ids'=> $deviceToken,
            'data'=> $msg
        ];

$headers = array('Authorization: key=' . $apiKey,'Content-Type: application/json');    
if ($headers){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://fcm.googleapis.com/fcm/send");
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
    $response = curl_exec($ch);
    if ($response === FALSE) {
        die('FCM Send Error: ' . curl_error($ch));
    }
    curl_close($ch);
}

凭据正确。

这是入站安全规则

enter image description here

我甚至将“公共可访问性”设置为“是”(我不想),但是没有运气。有什么帮助吗?谢谢

编辑1:

重启rds实例后telnet的输出:

mysql -h <host>.rds.amazonaws.com -P 3306 -u admin -p
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on '<host>.rds.amazonaws.com' (111)

路由表: enter image description here

网络ACL: enter image description here

0 个答案:

没有答案