Unable to connect to AWS RDS using AWS CLI – Error 2002


This Content is from Stack Overflow. Question asked by nbz

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!


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?