2
votes

I am trying to connect to my database from local machine but I am getting the following error.

ERROR 2003 (HY000): Can't connect to MySQL server on 'finaltesting2.cluster-cxtmwsuqx4ty.us-east-1.rds.amazonaws.com' (110)

Things I have done:

1: Changed the vps security group for inbound traffic. For testing purpose, I have even allowed all TCP traffic from all of the IP range

2: I don't have any firewall on my local machine that is blocking me to connect to port 3306

3: I have already looked many similar issues on stackoverlow and the answers is just to change the inbound rules but its not working for me.

4: I have proper internet connection for my local machine. i-e no network issue

rds enter image description here enter image description here

1
Have your aurora is set for public access? If your connection point is different with aurora VPC then you might need to open public access.Lamanus
I have enabled the data api. I can't see any public access option. Won't editing the inbound rules will make it public? Would you please guide me how can I make it public? Thanksjohn
Oh, I noticed that your aurura is severless version which is not allowed set to public. To access the aurora serverless, you should be in the same vpc with the aurora. If you try to access it from local, I guess it is not possible.Lamanus
Thanks @Lamanus. Appreciate your help. :)john
Hi John, Do you mind accepting the answer unless you think something needs more clarification?The-Big-K

1 Answers

2
votes

Aurora Serverless (and may other AWS DB offerings - like Amazon Neptune, DocDB etc) are VPC only. You can still connect to them outside of the VPC with some additional setup. I've elaborated a few here: [1] [2]

[1] Connect to Neptune on AWS from local machine

[2] AWS Aurora MySQL serverless: how to connect from MySQL Workbench

Note that the above solutions are for non production setups. If you need something more resilient, you would need to have more infra in place. For example - If you are using an ALB to expose your DB endpoint outside of the VPC, then you need to have mechanisms that would make sure that the ALB is always pointing to the right IP of the DB instance, as IPs are bound to change when failover and host replacements happen. Do keep that in mind.