Amazon AWS Issue - Accessing MySQL from EC2

I am working on an Android app with basic user registration / login. I am currently working on my localhost running WAMP Server.

I wanted to take it one step further by taking an Amazon RDS (MySQL) instance and hosting my php files on some server (EC2 instance perhaps) and letting the Android app make an HTTP request to the php file which inturn connects to the MySQL instance.

So far I have created MySQL Instance and an EC2 instance (with LAMP setup)

. I cannot connect to the MySQL instance from the EC2 instance (I ssh to EC2 via Putty and tried to connect to the 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 has to do with an installation VPC security groups

that I cannot configure for the MySQL instance.

EC2 and RDS exams are located in the Singapore region. Here's a snapshot of the VPC I have:

enter image description here

Here is the error message I see on putty:

enter image description here

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

+3


source to share


1 answer


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

  • Go to the RDS Console. Click a database instance. You will see a screen like this:enter image description here




  1. Go to the tab Security Groups

    . Click onInbound -> Edit -> Change the Source to 0.0.0.0\0

enter image description here

0


source







All Articles