skip to Main Content

I’ve set up a basic AWS RDS in the free tier. No public access but created a security group with my IP address added as an inbound rule.

For authentication I have RDS password plus AWS IAM.

I try to connect to the db via my computer (Ubuntu) with the following command:

mysql -h <db-conn>.amazonaws.com -P 3306 -u admin -p

I’ve already looked at this answer – Cant connect to mysql server on AWS RDS My port isn’t blocked and I’ve checked the security group. I am able to successfully run AWS CLI commands like this:

aws rds describe-db-instances --filters "Name=engine,Values=mysql" --query "*[].[DBInstanceIdentifier,Endpoint.Address,Endpoint.Port,MasterUsername]"

But every time I run the mysql command, I get the following error:

ERROR 2002 (HY000): Can't connect to MySQL server on '<db-conn>.amazonaws.com' (115)

Would love some assistance with this. Thanks!

2

Answers


  1. check your ip that config in the security group, it is need your public ip not like ‘192.168.xxx.xxx’, you can get your public ip by google

    Login or Signup to reply.
  2. For being able to connect to your AWS RDS system and not letting anyone to connect you need to do the following steps:

    • Set your Publicly Accesible property to YES in your RDS configuration. That will give the system a Public Subnet address and allow it to be accesible from outside your VPC.
    • Go to your security group and allow access to your RDS system (the port 3306 that you are trying to connect) only from your VPC and from your public IP. This makes changes in your firewall rules.

    In that way you will be able to access your RDS from your public IP, but noone else will be able to access.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search