# Add RDS instance - connection check failed

**URL:** <https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748>\
**Category:** Uncategorized\
**Tags:** mysql, percona\
**Created:** [August 28, 2023, 12:15pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748 "2023-08-28T12:15:17Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Milo\_Stein](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/milo_stein/32/12486_2.png) [@Milo\_Stein](https://forums.percona.com/u/Milo_Stein)\
**Post date:** [August 28, 2023, 12:15pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/1 "2023-08-28T12:15:17Z")

</div>

when adding a new service via RDS, after entering DB username & password, the connection check fails even though username & password are correct and port 3306 is open. Why can’t Percona (hosted on an EC2 instance) connect to my RDS instance?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 28, 2023, 3:10pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/2 "2023-08-28T15:10:48Z")

</div>

Hello @Milo_Stein,  
On your PMM-EC2 instance, can you access MySQL RDS via command line using the same credentials? If this test fails, then you have permissions issues on your RDS. Please perform this basic connectivity test and let us know the results.

---

<div class="post-metadata">

**Author:** ![Milo\_Stein](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/milo_stein/32/12486_2.png) [@Milo\_Stein](https://forums.percona.com/u/Milo_Stein)\
**Post date:** [August 29, 2023, 1:53pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/3 "2023-08-29T13:53:01Z")

</div>

Hi Matthew, thanks for your quick support. Instance Connect doesn’t work because apparently, the username is not the default “root” or “ec2-user”, ssh gives me a permission denied even though I used the right key. How can I establish a connection with the EC2 then?

---

<div class="post-metadata">

**Author:** ![Milo\_Stein](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/milo_stein/32/12486_2.png) [@Milo\_Stein](https://forums.percona.com/u/Milo_Stein)\
**Post date:** [August 29, 2023, 6:46pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/4 "2023-08-29T18:46:54Z")

</div>

@matthewb Hi again 🙂

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 30, 2023, 1:32pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/5 "2023-08-30T13:32:12Z")

</div>

Did you launch PMM using our AMI? If so, I believe the username for ssh is ‘admin’.

---

<div class="post-metadata">

**Author:** ![Milo\_Stein](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/milo_stein/32/12486_2.png) [@Milo\_Stein](https://forums.percona.com/u/Milo_Stein)\
**Post date:** [August 30, 2023, 1:47pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/6 "2023-08-30T13:47:58Z")

</div>

Thanks Matthew, that worked now. But how do I test the connection to the db? mysql -h etc. didn’t work. Would appreciate your help!

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 30, 2023, 3:33pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/7 "2023-08-30T15:33:33Z")

</div>

Please paste the command you used. It is very hard to assist when I can’t see the command/output.

---

<div class="post-metadata">

**Author:** ![Milo\_Stein](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/milo_stein/32/12486_2.png) [@Milo\_Stein](https://forums.percona.com/u/Milo_Stein)\
**Post date:** [August 31, 2023, 7:35am UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/8 "2023-08-31T07:35:30Z")

</div>

all mysql commands show command not found. Is there an alternative to check the connection?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 31, 2023, 12:37pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/9 "2023-08-31T12:37:14Z")

</div>

> [@Milo\_Stein](#):
>
> all mysql commands show command not found.

You need to install the mysql client. This is all “troubleshooting 101”. You need to perform basic connection tests/checks. There is a mysql client docker image you can try too if you are more familiar with docker.

Try using `telnet rds.address.aws 3306` and if that doesn’t show a mysql attempt, then you have RDS/security groups issues that you must resolve first.

---

<div class="post-metadata">

**Author:** ![Milo\_Stein](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/milo_stein/32/12486_2.png) [@Milo\_Stein](https://forums.percona.com/u/Milo_Stein)\
**Post date:** [August 31, 2023, 1:23pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/10 "2023-08-31T13:23:42Z")

</div>

thanks Matthew, I managed to make the connection check work, but it fails. I added the Public IP of the PMM EC2 into the rules of the DB security group, but i get a ERROR 2003 (HY000)

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 31, 2023, 2:33pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/11 "2023-08-31T14:33:52Z")

</div>

It is very difficult to assist when I can’t see the entire output of what you are doing and the exact commands you are executing.  
Error 2003 is a generic connection failure message and doesn’t really help here.  
I suggest you ask someone else on your team to assist with these basic networking troubleshooting tasks. If the telnet fails, then you have fundamental network blocks (security group, firewall, etc).

This is what a SUCCESSFUL telnet test looks like:

```auto
$ telnet rds-mysql.xkk82ldd.us-west-2.rds.amazonaws.com 3306
Trying 10.46.124.102...
Connected to rds-mysql.xkk82ldd.us-west-2.rds.amazonaws.com.
Escape character is '^]'.
N
5.7.38-log�K- dL|?Pt;=/0C9=mysql_native_password

```

Again, the above is a SUCCESS test. The above shows that the EC2 instance is able to talk to MySQL and MySQL has returned a challenge for authentication. If you don’t get then when substituting your RDS endpoint, then you have basic networking issues that need to be resolved.

---

<div class="post-metadata">

**Author:** ![Milo\_Stein](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/milo_stein/32/12486_2.png) [@Milo\_Stein](https://forums.percona.com/u/Milo_Stein)\
**Post date:** [September 1, 2023, 2:04pm UTC](https://forums.percona.com/t/add-rds-instance-connection-check-failed/24748/12 "2023-09-01T14:04:55Z")

</div>

Hi Matthew, the telnet fails. Connection timeout. Again, I added the EC2 as a rule to the security group, so what other networking issue could be problematic here?
