Connect AWS RDS on MySQL Workbench

Tram Ho

For more convenience in manipulating RDS database on GUI like MySQL Workbench today, we set up the settings together!

  1. Setup an EC2 in the same VPC as RDS as the intermediate server to connect to the DB.

    Some points to note with this intermediate EC2:

  • In the VPC network, select the VPC that RDS is in.
  • In Subnet, select the public subnet and enable Auto-assign Public IP.
  • If you allow people to access this EC2, the Security Group is set to 0.0.0.0/0, and if it’s private, open port 22 for the allowed IP access.
  • Save the key pair (File .pem) to the local machine.
  • Check the Security Group of RDS to see if EC2 access is allowed.

    Check the RDS connection from EC2 to see if it is okay by ssh to EC2 install mysql-client suitable for EC2 operating system

  1. Setup settings on the Mysql Workbench GUI

  • Connection Name: Optional
  • Connection Method: Select Standard TCP / IP over SSH
  • SSH Hostname: Public IP Address of EC2 created in step 1 and SSH port (Example: 10.33.33.33:22)
  • SSH Username: Depending on the operating system selected for EC2 is usually ec2-user (If it is another OS, refer to the username here https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managing-users .html )
  • SSH Password: Not required
  • SSH Key file: Path to .pem file in step 1
  • MySQL Hostname: DNS name of the RDS database
  • MySQL Server Port: Port of RDS MySQL (usually 3306)
  • Username: User of RDS
  • Password: Password of RDS

Click Test connection if successful, press OK to save the connection.

Thank you everyone for reading here !!

Share the news now

Source : Viblo