How to connect MySQL Workbench to Amazon RDS?

50,832

Solution 1

In the MySQL forums is a posting that links to various sources for connecting MySQL Workbench to online resources: http://forums.mysql.com/read.php?152,252640,252640#msg-252640. The essential steps for Amazon RDS are on this page: https://thoughtsandideas.wordpress.com/2012/05/17/monitoring-and-managing-amazon-rds-databases-using-mysql-workbench/

Step 3) Fill in the values as described below which illustrated in Figure 4.

  • Connection Name – Provide a name to identify your connection Connection Method – Select Standard TCP/IP over SSH from the drop down list instead of Standard(TCP/IP). Then on the appearing two tabbed pane, fill the following values found under Parameters tab.
  • SSH Hostname – Provide the Public DNS of the Amazon EC2 instace (refer Figure 3) which will be used as the intermediate server instance used to create the connection with the DB instance.
  • SSH Username – Provide the user of the Amazon EC2 instance (refer Figure 3) which will be used as the intermediate server instance used to create the connection with the DB instance.
  • SSH Key File – Provide the Private Key (xxx.pem) used to connect Amazon EC2 instace via SSH
  • MySQL Hostname – Provide the Endpoint of the DB instance created in Amazon RDS(refer Figure 5).
  • Username – Provide the Master Username of the DB instance created in Amazon RDS(refer Figure 5).

  • Password – Click on Store in Keychain.. button and type the password provided while creating the DB instance in Amazon RDS.

Solution 2

This solution worked for me: Add your IP to the Security Group rules as follows. Assuming you have logged into AWS:

  1. Go to RDS -> Databases -> Select your database

enter image description here

  1. Make sure the Public Accessibility value is Yes enter image description here

  2. Check your IP address using http://checkip.amazonaws.com/. If it is not added to the Security Rule Groups, you should add it. this step is crucial

3.1. Click on the rule name. This will open up a new tab, then click in the name of the rule.

enter image description here

3.2. Click on Edit inbound rules

enter image description here

3.3. Click on Add new rule, and add a rule with the following values:

Type: MYSQL/Aurora.

Protocol: TCP (default)

Port range: 3306 (default)

Source: My IP -> This will be the IP Address you got at http://checkip.amazonaws.com/.

enter image description here

  1. Fill information in MySQL Workbench

enter image description here

Hostname: Use the value you have for Endpoint at Connectivity and Security

Port: Use the value you have for Port at Connectivity and Security, by default it is 3306.

Username: Use the value you have for master username at Configuration

Password: Use the value you set when you created the database instance.

If you forgot the password, you can change it by clicking on Modify in your database instance or if you're using AWS Elastic Beanstalk or so you can SSH into the instance and run the command

/opt/elasticbeanstalk/bin/get-config environment

and you'll find that information in it.

enter image description here enter image description here

Solution 3

  • In the MySQL Workbench Click on Setup new Connection,
  • Give the Connection name and Select the Connection method as Standard TCP/IP,
  • Enter the host name from RDS end point and port as 3306,
  • Enter Mysql user name and password as given in RDS instance creation,
  • Then test the connection and click ok.

Test MySQL Connection

Share:
50,832

Related videos on Youtube

AnilS
Author by

AnilS

Tech Enthusiast and Launched multiple "zero to one" products, have a holistic view of the end-to-end requirements-design-development-delivery process of the feature.Managed the entire product life-cycle of new product development and Automate the CI/CD process. Experience as a Head of product acting as the "CEO of the product" for various products.

Updated on July 09, 2022

Comments

  • AnilS
    AnilS almost 2 years

    I am accessing the Amazon RDS (MySQL) from Putty. MySQL Workbench works through SSH commandline only, but I would like to access the cloud MySQL host database directly from MySQL Workbench.

  • Mike Lischke
    Mike Lischke about 9 years
    Anil, if an answer was helpful please accept it by clicking the check mark left to it. You can even upvote for additional points if you feel the answer deserves it.
  • Thomas Wood
    Thomas Wood over 8 years
    Also make sure you use a PEM key and not a PPK key
  • Bryan_C
    Bryan_C over 6 years
    if using AWS documentation (aws.amazon.com/getting-started/tutorials/create-mysql-db) in Step 3b the UI has changed so the endpoint info is not there as they instructed. to find: services > RDS > Instances > click the instance name link > search = endpoint. you will see it under "Connect" module
  • kryzystof
    kryzystof over 3 years
    Worked great. Thanks for that
  • chaudim
    chaudim about 3 years
    Works like a charm. Thanks.
  • harshit2811
    harshit2811 almost 3 years
    I have followed that but still getting "Lost connection to MySQL server at 'reading initial communication packet', system error: 54" in mysqlworkbench.
  • ManojKumar
    ManojKumar over 2 years
    I followed all the steps but I was still getting error message "Unable to connect to <host>". Later I realized, my system was connected to my organization's VPN. I disconnected the VPN on my system > visited site "checkip.amazonaws.com" again> this time my IP was different > I provided this IP in this answers step "inbound rule" , "source" . After this, I was able to connect from MySQL Workbench
  • Mahmudul Hassan
    Mahmudul Hassan over 2 years
    my ip changing . what value should i put when adding new rules . any help ?
  • saigopi.me
    saigopi.me about 2 years
    Worked well, thank you so much saved life.
  • Euridice01
    Euridice01 about 2 years
    Does the Public Accessibility have to be yes to connect this way? What if I want to connect but not have it publicly accessible?