Reputation: 181
Am following this tutorial http://thoughtsandideas.wordpress.com/2012/05/17/monitoring-and-managing-amazon-rds-databases-using-mysql-workbench/
I am not able to Test DB Connection while creating new server instance to connect to the RDS database. It says Bad_Authentication[allowed_types=public_key], i have a tried different .pem files and have done through a lot of forums. I have also allowed access to my IP in the DB SecurityGroups for RDS and the Security Groups for EC2.
Please help me out. Thanks.
Upvotes: 15
Views: 39589
Reputation: 107
It was a nightmare for me until I realized that wifi could be an issue. Just try to connect the SQL workbench with a different WiFi or Internet.
Upvotes: 0
Reputation: 59
All of the other answers are extremely helpful to debug the connection process but for me the literal fix was to not put in the password into the keychain when initializing the MySQL Connections. Instead, I pressed Test
and put in the password when prompted to do so. Running on macOS Monterey V.12.3.1 with a MBP M1, 2020
Upvotes: 0
Reputation: 1384
In my scenario the problem was simple
I had to enable 3306 port for MYSQL in the related Security group in RDS > db instance section.
Upvotes: 6
Reputation: 61
Make sure Public accessibility should be yes.
Also, Inside security Group section, click on the security link and then add a new rule under inbound rule section which will whitelist your IP address with the below data :
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/.
Hope this will help to connect with AWS RDS successfully. Thanks!
Upvotes: 2
Reputation: 523
I had the same issue. I think you need to enable inbound traffic to the VPC. Follow the below article and you'll be fine. Default VPC is not allowing users to access 3306 by default and you need to allow traffic.
Upvotes: 2
Reputation: 69983
This worked for me. Assuming you have logged into AWS:
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.
3.2. Click on Edit inbound rules
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/.
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)
I hope this also helps you.
Upvotes: 75
Reputation: 11
Even I had the same issue, like after trying all the things out there. A thing worked is modifying the RDS database and making it publically accessible. That sorted things out.
Upvotes: 0
Reputation: 1708
If you are not using EC2 Instance to connect with RDS DB Instance then DB Instance should have public access to connect.
If you want to use EC2 Instance and connect DB Instance over EC2 Instance, you have to use Standard (TCP/IP) over SSH option. Check the following link What would prevent me from connecting to a MySQL server on AWS RDS from an AWS EC2 VM?
Upvotes: 2
Reputation: 21
For RDS no need to use ssh. You can directly connect the RDS with MySql workbench. Follow the following steps-
Make sure that in Security Group you should have provide access for MYSQL
Upvotes: 1
Reputation: 3641
Based on the details in your question, it seems that you are trying to SSH into the RDS instance. This is not supported on RDS, it only works for EC2 based MySQL servers.
You should instead connect directly to the MySQL server, on port 3306 (or the one you set manually, if this is the case) and using the username and password you created when provisioning the RDS instance. This means using the Connection Type "Standard TCP/IP" in WB.
Also, the public IP address of the machine you're using MySQL Workbench on should be allowed in the RDS security group.
Upvotes: 0