I am just trying to connect to an Amazon MySQL RDS instance from MySQL Workbench on my local machine. I am not trying to connect from an EC2 instance or any other server at this point or do anything special. I simply want to connect in the most basic way so I can add a database, tables, and some data from within MySQL Workbench.
I have the MySQL Workbench application downloaded and installed on my Mac computer running OSX 10.9.4.
I have set up a MySQL RDS instance on Amazon AWS.
I have an EC2 Security Group that is authorized for this RDS instance. (Should I be using a CIDR/IP security group? If so can you go into more detail please)
I opened MySQL Workbench and am in the Setup New Connection window:
When I test the connection in WorkBench, I get the error:
Can't connect to MySQL server on 'SERVER_IP_ADDRESS' (60)
What am I doing wrong? Please go step by step from the beginning for a newbie.
I have an EC2 Security Group that is authorized for this RDS instance. (Should I be using a CIDR/IP security group? If so can you go into more detail please)
This is the part you seem to be missing. You need to edit your security group settings:
You need to authorize the IP of the computer that is trying to connect to the RDS instance by CIDR/IP. If you are using the same computer to edit the security group as you are using to try to connect via MySQL Workbench then when you select the "Connection Type: CIDR/IP" (at the bottom of the Security Group settings) the dialog will auto-fill with your own IP block (Your IP appended with /32).
Click Authorize and that should do it.
I have experienced this authorization to take from a few seconds to a minute to visually complete in the AWS Console, but once it says "Authorized" the connection should work.
That is, of course, assuming your connection string is correct. ;)
Few things you want to make sure:
For me, the last one slipped through. Specifically I added a destination to the route table leading to 0.0.0.0/0 (ALL). I don't know the security implication of this, but it worked after that. This is a throwaway db for me and it's isolated from other instances/VPCs.
This link helped me:
SSH Hostname should be the public DNS of your ec2 instance.
SSH Username should be the username for your ec2 instance (eg: ec2-user).
SSH password should be your password for ec2 instance.
MySQL Hostname should be the "endpoint that you find on your RDS Dashboard"
Username and password should be the username and password for the rds instance.
e.thompsy's answer helped me however things have changed in the AWS interface since then. In order to allow your computer's IP to access the MySQL instance:
I'm not aware of the security implications of opening that port to your IP. If you are worried, I suggest you revoke the Inbound Rule when you are done needing access to the RDS instance.
You have a couple of options:
Amazon's instructions for the task seem decent, so I'm not going to try to duplicate the whole thing here; just the relevant parts. I use the command line, but the same settings apply for MySQL Workbench as well:
mysql -h hostname
If this is not helpful, feel free to leave a comment.
To connect Mysql RDS via MySQL Workbench, try below steps.
Type : mysql -h -P 3306 -u -p in windows cmd [you will be prompted to enter password] If Security group and username,pwd are correct , you will get mysql dialog
ERROR 2003 (HY000): Can't connect to MySQL server on '' (10060) - error occurs when NO Inbound rules are there.
Always try to maintain a new Security Group for DB.
If default Security group is selected, access is denied by default.
Security group Inbound rule has to be modified to MYSQL/Aurora TCP 3306 MyIP
it gets connected.
You can simply use workbench recommended by aws but make you you all SSL and MYSQL/Aurora availibily on for everywhere..while adding MYSQL/Aurora 3306 to security group
https://aws.amazon.com/getting-started/tutorials/create-mysql-db/
Sounds like your issue is you need to set your inbound RULES to accept your development machine IP. Once you do that, you can use MySQL Workbench to connect to MySQL RDS.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.