Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS RDS Error 2003

I am unable to connect to my RDS instance and keep getting

ERROR 2003 (HY000): Can't connect to MySQL server on "my endpoint"

I know that this error comes because my PC is not authorized to access the database because of Public Accessibility, but I am unable to get my PC to authorize in security groups.

I opened the RDS security groups and it says this:

Using VPC? Visit the VPC page to create or manage VPC Security Groups and ingress rules to your DB Instances in VPC. Learn more about the differences between DB Security Groups and VPC Security Groups here.

Your account does not support the EC2-Classic Platform in this region. DB Security Groups are only needed when the EC2-Classic Platform is supported. Instead, use VPC Security Groups to control access to your DB Instances. Go to the EC2 Console to view and manage your VPC Security Groups. For more information, see AWS Documentation on Supported Platforms and Using RDS in VPC.

So I opened VPC security groups and added another security groups with

Type : MySQL(3306) Protocol : TCP(6) and Source as my IP and another for my EC2 instance.

and added this to my RDS security group.

Nothing happened. So I check a tutorial and they added a CIDR/IP and I cannot find that.

Edit:

I created another RDS instance with Public Accessibility as Yes. I have been able to do this successfully with Public Accessibility as Yes. I changed the source to something other than my PC IP and it didn't work. It gives the same error.

like image 940
Mayank Avatar asked Sep 28 '22 16:09

Mayank


1 Answers

For me, the security group for mysql is set to a particular ip address (when creating a new mysql RDS instance, the default ip is the current public address of you pc/laptop.

However, after restarting my laptop, the ip changes... which means i need to add the current laptop public address to the security group --> inbound --> Type: MYSQL/Aurora, Protocol: TCP, Port Range: 3306, Source: "Your Public IP Address"

You can search for my public address in google to get the ip address. enter image description here

enter image description here

like image 156
user1872384 Avatar answered Oct 02 '22 13:10

user1872384