Search code examples
mysqldatabaseamazon-web-servicesamazon-rds

AWS: can't connect to RDS database from my machine


The EC2 instance/live web can connect just fine to the RDS database. But when I want to debug the code in my local machine, I can't connect to the database and got this error:

OperationalError: (2003, "Can't connect to MySQL server on 'aa9jliuygesv4w.c03i1 ck3o0us.us-east-1.rds.amazonaws.com' (10060)")

I've added .pem and .ppk keys to .ssh and I already configure EB CLI. I don't know what should I do anymore.


Solution

  • It turns out it is not that hard. Do these steps:

    1. Go to EC2 Dashboard
    2. Go to Security Groups tab
    3. Select and only select the RDS database security group. You'll see the security group detail at the bottom
    4. Click Inbound tab
    5. Click Edit button
    6. Add Type:MYSQL/Aurora;Protocol:TCP;Range:3306;Source:0.0.0.0/0

    Steps