Connecting to Amazon RDS instance through EC2 instance using MySQL Workbench

前端 未结 7 1109
囚心锁ツ
囚心锁ツ 2020-12-07 22:45

In AWS I have a VPC set up with a Bastion Host. The bastion host is a single EC2 instance with a public address trough which you can SSH to any other server on the VPC.

7条回答
  •  太阳男子
    2020-12-07 23:36

    You can create an SSH tunnel into your Bastion host (EC2 instance) to forward ports from your local machine to the remote RDS instance.

    on mac/ linux this is the command (for windows follow instructions in the link below):

    ssh -L 3306:myinstance.123456789012.us-east-1.rds.amazonaws.com:3306  your_c2_ip
    

    then you can connect with workbench using the following settings:

    • connection method: standard TCP

    • hostname: localhost

    • port 3306

    This post explains it the method in more detail; https://userify.com/blog/howto-connect-mysql-ec2-ssh-tunnel-rds/

提交回复
热议问题