2

So I've been working on this issue for a while now, and I'll explain what I'm trying to do. I'm trying to connect to a MySQL database server, hosted by Amazon Web Services in the Amazon RDS service. The database is up and running, and I've created a security group, as well as an EC2 security group. Within the Ec2 security group, I've opened up port 3306 (the MySQL port), and added it as a rule. I've then applied this rule. I've then connected the security group to the EC2 security group, and I connected the database to the security group. Thus the database should have port 3306 open (and for all I know it does!).

So here's the issue. I'm trying to connect to the MySQL server based on the IP of the database I'm given by Amazon Web Services. However, when I attempt to connect via the Terminal command shell, the connection times out, saying that the MySQL connection failed.

Here's what I type in: "mysql -h *****.rds.amazonaws.com" where the asterisks are part of the IP address.

The error is as follows: "ERROR 2003 (HY000): Can't connect to MySQL server on '*****.rds.amazonaws.com' (60)"

I've also tried specifying a username and password to the command, but the same error occurs.

Any thoughts as to why the connection is failing?

Thanks, any help appreciated!

Jake

  • EC2 security groups and DB security groups are, for the most part, unrelated things, except for the ability for instances one one group to grant accesses to instances in another... and in no case do you ever have to open 3306 explicitly to access RDS... so it does not sound like you are configuring the right thing in the right place. The source IP of the machine you are trying to connect from needs to be configured in the DB security group, and that is all you need in order to acces RDS. – Michael - sqlbot Oct 5 '13 at 5:08
  • Are you using VPC? Are you trying to connect from the Internet or from an EC2 instance? Is this a new setup, or a new problem in a formerly-working setup? Try perror 60 for an explanation of what the (60) at the end of the error means. – Michael - sqlbot Oct 5 '13 at 5:11
  • Trust me I've tried everything. Try the US-West region. It works for me! I can't get one working in US-East. Seems to be a bug that's been going on forever since they merged DB Security Groups and VPC Security Groups. – Neo Nov 13 '14 at 8:13
1

1) Make sure that RDS instance has access to ec2 instance from where you are trying to connect

2) From ec2 instance connect to Amazon RDS instance using telnet $telnet

If telnet fails means connection to MySQL port is not possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.