connect-aws-rds-mysql

How to Connect to AWS RDS MySQL

Amazon RDS makes it easy to run a MySQL database in the cloud. Once your RDS instance is up and running, you can connect to it from a local machine using tools like the MySQL command line client or database GUI tools such as MySQL Workbench. This guide shows you the steps to securely connect to your RDS MySQL database using the correct settings.

How to connect to AWS RDS MySQL

Step 1: Launch your RDS MySQL instance

If you haven’t already created an RDS instance, go to the RDS Dashboard in the AWS Console and click Create database. Here, choose MySQL as the engine and set your DB instance identifier, master username, and password.
You can choose Public access = Yes if you want to connect from outside AWS. Now, finish the setup and wait for the instance to become Available.

Step 2: Get the endpoint and port

Once the instance becomes available, go to RDS Dashboard > Databases, click on your RDS instance and copy the Endpoint (e.g., your-db-instance.abcdefg12345.us-east-1.rds.amazonaws.com). Also, make a note of the Port (default is 3306).

Step 3: Make sure the security group allows access

Go to EC2 Dashboard > Security Groups, find the security group associated with your RDS instance and edit the Inbound rules to allow MySQL/Aurora (port 3306). Now, set the source to your IP address or Anywhere (0.0.0.0/0) if for testing (not recommended for production).

Step 4: Use a MySQL client to connect

To connect, open your terminal and type the following command:

mysql -h your-endpoint.rds.amazonaws.com -P 3306 -u your-username -p

You’ll be prompted to enter your password. Once you do that, you’ll be connected to the database.

Pump saves ~60% on CLOUD *for free*

FAQ

What is the default port for RDS MySQL?

The default port for RDS MySQL is 3306, which is standard for MySQL databases.

Why can’t I connect to my RDS MySQL instance?

If you can’t connect to your RDS MySQL instance, you might want to check that the public access is enabled in your DB instance settings, your Inbound rules in the security group allow port 3306 and that you’re using the correct endpoint, username, and password.

Do I need to install anything to connect via terminal?

Yes, you need the MySQL client installed on your local machine. If you don’t have it already, you can install it using Homebrew or your OS’s package manager.

Is it safe to allow public access to my RDS instance?

In terms of safety, it’s not recommended to allow public access to your RDS instance for production environments. If you must allow it temporarily, restrict it to your IP address.

Get started with PUMP for free

No contracts, no credit card needed to sign up

Get started with PUMP for free

No contracts, no credit card needed to sign up

Get started with PUMP for free

No contracts, no credit card needed to sign up

1390 Market Street, San Francisco, CA 94102

Made with

in San Francisco, CA

© All rights reserved. Pump Billing, Inc.