AWS RDS MySql: connect from local Workbench

471 Views Asked by At

I am very much confused right now, since a connection from my local MySQL workbench to an instance in AWS RDS does not work anymore. I have a dynamic IP, so I edited the inbound rules in the AWS security group to reflect that, but I am still getting error: "MySQL Error 2003 (HY000): Can't connect to MySQL server on 'xyz.us-east-1.rds.amazonaws.com' (10060)"

I also tried to establish a connection via Command Prompt but same result there. What I want to try next is using MySQL shell, but I am not sure how to change the user in the connect statement. Entering

\connect --mysql xzy.us-east-1.rds.amazonaws.com

returns a prompt, asking me to provide the password for '[email protected]'. However, I obviously do not want to connect with my Windows User but the admin of the DB instance. How can I change the user? Typing -u admin -p results in enter image description here

Thanks a lot for any hint!

edit: I am also admin of the AWS RDS instance, so I can see it is up & running

edit1: here is the reply I get for nslookup: enter image description here as well as a picture of the security group: enter image description here

1

There are 1 best solutions below

1
prashant thakre On

BTW, answer is it's not best practice to connect your aws RDS instance from local means from outside the aws account. It must be in private VPC.

However, still if you need use this.

Pass the -u with username using command line the below one :

mysql -u {username} -p'{password}' \
    -h {remote server ip or name} -P {port} \
    -D {DB name}

\connect --mysql -u admin xzy.us-east-1.rds.amazonaws.com