Need help?

Our experts have had an average response time of 13.14 minutes in February 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Connect to an Amazon RDS MySQL DB instance with Amazon RDS Proxy

by | Sep 27, 2021

Trying to connect to an Amazon RDS MySQL DB instance with Amazon RDS Proxy? Find out what our top Support Engineers have to say.

Are you having difficulty connecting your Amazon Relational Database Service DB instance with Amazon RDS proxy? Well, you have come to the right place. Bobcares is here to answer all your queries, big and small.

How to connect to an Amazon RDS MySQL DB instance with Amazon RDS Proxy

In order to connect your Amazon RDS MySQL DB instance with your Amazon RDS proxy, they both need to be in the same VPC. Although the database can be made publicly accessible, this is not an option for the proxy. Let’s see what our Support Engineers recommend:

    1. First, use AWS Secrets Manager to create database credentials.
    2. Then, create an IAM policy and IAM role.
    3. After that, create an Amazon RDS Proxy.
    4. Then, verify if the proxy endpoint is reachable:
      nc -zv  3306

This will result in an output similar to this:

nc -z test-proxy.proxy-xxxxxxxxxxxxx.eu-west-1.rds.amazonaws.com 3306
Connection to test-proxy.proxy-xxxxxxxxxxxxx.eu-west-1.rds.amazonaws.com 3306 port [tcp/mysql] succeeded!

Although, we would like to point out that you can run this command only on an EC2 machine in the same VPC as the proxy. The command will not run on local machines.

    1. Next. Connect to the RDS DB instance via the Amazon RDS proxy with this command:
      mysql -h  -u username -p

This results in an output similar to this:

mysql -h test-proxy.proxy-xxxxxxxxxxxxx.eu-west-1.rds.amazonaws.com -u admin -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2946664484
Server version: 5.7.28-log
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Mysql>

You can also connect to the RDS DB instance via Amazon RDS Proxy with an SSL connection with these steps:

  1. First, enable Require Transport Layer Security when the Amazon RDS Proxy is created. Changing this parameter to Required ensures that connections use SSL.
  2. Next, go to Amazon Trust Services and download Amazon Root CA1 trust store .pem file.
    wget https://www.amazontrust.com/repository/AmazonRootCA1.pem
  3. Then connect via SSL:
    mysql -h test-proxy.proxy-xxxxxxxxxxxxx.eu-west-1.rds.amazonaws.com -u admin --ssl-mode=REQUIRED --ssl-ca=AmazonRootCA1.pem -p

    You can also use this command:

    mysql -h test-proxy.proxy-xxxxxxxxxxxxx.eu-west-1.rds.amazonaws.com -u admin --ssl-mode=VERIFY_IDENTITY --ssl-ca=AmazonRootCA1.pem -p

    Once connected, you will get the following output:

    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 12659040
    Server version: 5.7.28-log
    Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    [Need assistance with Server Management? We are here to help.]

    Conclusion

    In short, we saw how easy it is to connect to Amazon Relational Database Service DB instance via Amazon RDS Proxy. The Support Team at Bobcares has a solution to any query.

    PREVENT YOUR SERVER FROM CRASHING!

    Never again lose customers to poor server speed! Let us help you.

    Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

    GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF