0
votes

I have hosted a play framework web application on Amazon EC2 instance. The application is not able to connect to a mysql database located on the Amazon RDS instance. When I run the play framework web application on my local computer it successfully connects to the database on the Amazon RDS instance. I checked the database connection credentials in the production conf file many times. Looks correct.

When I do

mysql -h********.rds.amazonaws.com -p****** -u****** db_name

from the local computer it quickly connects. But when I try same connection to RDS from EC2 it throws:

ERROR 2003 (HY000): Can't connect to MySQL server on ********.rds.amazonaws.com

Can anyone kindly help me with this or suggest anything that I may be possibly missing.

1

1 Answers

1
votes

Is RDS in VPC?

Yes, Check if EC2 is also in VPC or not.
No, Check security group that EC2 is in, allows the communication over database port

For more info and scenarios, head here