简体   繁体   中英

Amazon AWS Issue - MySQL Access from EC2

I am working on an Android App with basic user signup/login. Currently I have got it working on my localhost with WAMP Server running.

I wanted to take it a step further by taking Amazon RDS (MySQL) instance and hosting my php files on some server (probably EC2 Instance) and allowing the Android App to make a HTTP Request to the php file, which inturn connects to the MySQL instance.

So far I have created a MySQL Instance and an EC2 instance (with LAMP setup) . I am unable to connect to the MySQL instance from the EC2 instance ( I ssh into the EC2 via Putty, and tried to connect to MySQL instance using this command mysql -h devo.*.ap-southeast-1.rds.amazonaws.com -P 3306 -u mymasteruser -p ).

I am able to access it from my laptop though.

I think it is due to the VPC security groups setup, which I am unable to configure for the MySQL Instance.

The EC2 & RDS instance are in Singapore region. Here is a snapshot of the VPC I have:

在此输入图像描述

Here is the error message I see in putty:

在此输入图像描述

Any suggestions or links to some resources to sort this out would be highly appreciated.

I solved the problem. Here are the steps I followed.

  1. Navigate to RDS Console. Click the Database Instance. You would see a screen like this: 在此输入图像描述


  1. Click on the Security Groups tab. Click on Inbound -> Edit -> Change the Source to 0.0.0.0\\0

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM