Cant connect to mysql server on AWS RDS

前端 未结 2 1862
耶瑟儿~
耶瑟儿~ 2021-02-14 19:43

I am new to AWS RDS. I have created RDS instance.But i dont know, how can i connect this DB. I tried like this

mysql -h awsinstanamehere.rds.amazonaws.com -P 33         


        
2条回答
  •  离开以前
    2021-02-14 20:15

    I was having a little trouble with these answers so here are the steps I followed to get it working...

    1. Logged in via ssh to my ec2 instance.
    2. typed this command, curl canhazip.com
    3. copied the ip address that was returned
    4. went to my VPC Dashboard in aws
    5. clicked on Security Groups in the left column
    6. clicked on the checkbox next to one of the security groups
    7. clicked Edit under the Inbound Rules tab
    8. added this rule : MySQL/Aurora (3306) TCP (6) 3306 [IP from #2]/32
    9. saved

    I did this for every security group until the mysql connection worked from the command line, then deleted all of the ones that I didn't need, and retested to make sure I could still connect.

提交回复
热议问题