Reputation: 10208
I created a Elastic Beanstalk environment which created a EC2 instance and a RDS database.
It created security groups and everything. Also I know the configuration:
DB endpoint: xxxxx Port: 3306 Master username: uuuuu
But I cannot connect to it using mysql neither from inside ec2 or outside it.
I get a connection refused error.
Any help?
Upvotes: 10
Views: 5051
Reputation: 1267
For future viewers, there's now a pretty nice tutorial on how to connect an existing ElasticBeanstalk instance with an existing RDS database (MySQL, etc).
Ideally, you should NOT make the database while setting up the ElasticBeanstalk environment, as this binds the two together and there is currently no way to unbind them without terminating the environment.
Upvotes: 1
Reputation: 584
If you are still having this problem, check out your security groups. I was lost in a similar problem and solved it by allowing connections from the security group that the ec2 instance was running in to the security group the RDS database was running in.
So, if your EC2 instance is in the security group sg-randomec2name and your rds instance is in the security group sg-randomrdsname, edit the inbound rules for sg-randomrdsname to allow connections from sg-randomec2name.
Upvotes: 11
Reputation: 17889
I had a similar problem: The RDS MySQL instance for my EB app wouldn't respond to connect attempts. I just recreated a new database and refer to that in my EB app. There's no reason I know of that my separately created would perform any worse than the instance created by the EB wizard.
Upvotes: 0