Devart’s Birthday Sale Is On — 20% Off All Products
ends in   {{days}}
Days
{{timeFormat.hours}}
:
{{timeFormat.minutes}}
:
{{timeFormat.seconds}}

How to Connect to an Amazon RDS MySQL Database

In this article, we’ll demonstrate how to create an instance of a MySQL database with Amazon RDS and connect to it using dbForge Studio for MySQL.

Amazon RDS is a secure and reliable web-based service, which greatly simplifies the process of deploying, managing, and scaling relational databases in the cloud, thus, allowing you to connect at any time and from any place where Internet access is available.

Empowered by Amazon RDS for MySQL databases, you can:

  • Create, manage, and scale MySQL databases in the cloud
  • Perform automated backups, snapshots, and recoveries
  • Store and monitor database instances with a few clicks
  • Enhance performance and strengthen database security

How to deploy a MySQL database instance in Amazon RDS


Step 1: Open the Amazon RDS console

First of all, you should sign in to the AWS Management Console, just as shown in the screenshot.

Next, find RDS in the Database section of All Services and click it to open the Amazon RDS Console.

Amazon RDS Console

Step 2: Create an Amazon MySQL instance

To create a MySQL database instance in AWS, go to Databases on the side menu and click Create database. In this step, you will need to pick a database creation method, configure engine options, and select a database version.

Please note that when selecting the Standard database creation method, you will have an opportunity to configure database options, including the advanced ones.

Afterward, choose the MySQL engine and database version.

Creating AWS MySQL

Step 3: Select a template

Next, you will need to select a sample template for your future MySQL instance on Amazon RDS.

Depending on your use case, select the appropriate option: Production, Dev/Test, or Free tier.

Pay attention that the Amazon RDS Free tier is available for 12 months, and under this offer, you will receive 750 hours of RDS, 20 GB of general-purpose storage, and 20 GB for backups each month.

Select MySQL on AWS template

Step 4.1: Provide settings for your MySQL database on AWS

In this step, you will need to define the instance settings.

First, provide a unique name for your instance.

After that, think of a suitable master username and password. Make sure to save them as you are going to use them later to connect to Amazon RDS via dbForge Studio for MySQL.

AWS MySQL settings

Step 4.2: Continue configuring your MySQL instance

After you have set up the credentials for your instance, let's go ahead and define your future Amazon MySQL instance size and storage options.

Pick a DB instance class, storage type, and allocated storage that meet your workload requirements.

Note that you can expand the allocated storage to a maximum of 65 TB with Amazon RDS for MySQL.

Continue configuring AWS MySQL

Step 4.3: Define connectivity options

We have now reached the Connectivity section. Here, you can provide all the necessary connectivity configurations for your MySQL instance on AWS RDS.

Please note that you cannot change Virtual Private Cloud after the database has been created.

Connectivity settings

Step 5: Define advanced settings for your MySQL on AWS

In this step, you will need to configure additional database options required for AWS RDS to launch your MySQL DB instance. You can enable database backup, enhanced monitoring, and maintenance.

In the Maintenance section, we suggest selecting Enable auto minor version upgrade to receive automatic updates as soon as they become available.

Please note that if the Enable deletion protection option is enabled, you won't be able to delete the created database.

MySQL on AWS. Advanced settings

Step 6: Launch MySQL instance on AWS

After you have defined all the settings, you can finally click Launch DB Instance.

As soon as the instance process is finished (it might take some time), you will be able to check the status along with some other configuration details in the corresponding window, as shown on the screenshot.

To view the details of your MySQL instance, click the database instance name.

Check the details and click Create database to finalize the process.

View the created AWS MySQL database

Step 7: View MySQL instance details

Now, as we approached the Summary section, we can see the dashboard, as demonstrated in the screenshot. It provides MySQL instance details about recent events.

To check the necessary information, switch between the tabs. For instance, on the Connectivity & security tab, you can view the details associated with the MySQL endpoint.

Note that you will later need to specify both the DNS address from the instance endpoint (as host) and the port number (as port) in the connection string to connect to the MySQL instance.

When the status of the instance is Available, which means that the database instance has been deployed, you can go to dbForge Studio for MySQL to connect to Amazon RDS.

View MySQL instance details

Using dbForge Studio for MySQL to connect to an Amazon RDS MySQL database instance

Connect to an Amazon RDS MySQL database from a local machine

dbForge Studio is an excellent solution for SQL developers as it enables you to connect to the AWS RDS instance from a local machine and facilitates your database experience with its powerful built-in features. To configure remote access to your Amazon RDS instance via dbForge Studio for MySQL, do the following:

1. In Database Explorer, click Database Connection. Optionally, you can go to the Database menu > New Connection.

2. In the Database Connection Properties window, specify the Type of the connection, and enter the Host, Port, User, and Password.

3. Once all the settings are configured, click OK.

Now that you have successfully set remote connections to AWS RDS, you may want to dive deep and learn how to import MySQL data to Amazon RDS and export data from Amazon RDS to an on-premises MySQL database.

Use dbForge Studio for MySQL to connect to MySQL database

Video guide: How to connect to Amazon RDS for MySQL

Currently, Amazon RDS provides support for such database engines as Amazon Aurora, MySQL, MariaDB, PostgreSQL, Oracle, and Microsoft SQL Server. You can find detailed information on how to connect to the Amazon RDS MariaDB Database.

It's worth mentioning that dbForge Studio for MySQL can boast broad compatibility and connectivity options that are not limited just to Amazon RDS support.

Frequently asked questions

How does a MySQL database work in AWS RDS?

AWS RDS allows you easily to set up, manage, and scale MySQL databases in the cloud. You can deploy multiple editions of MySQL with resizable compute capacity.

With AWS RDS, you can focus on the application deployment while the system operates database administration tasks such as provisioning, monitoring, software patching, backups, hardware scaling, etc.

How can I export/import a database from/into AWS RDS?

The fastest way to back up and restore a database is to use full backup files (.bak files). You can access files stored in AWS S3 instead of using the local file system on a database server.

You can back up your local server, save it on S3, and restore it onto an existing RDS database instance any time you need. Also, it's possible to make backups from AWS RDS, store them on S3, and restore them wherever you want.

What databases does AWS RDS support?

AWS RDS supports AWS Aurora, MySQL, MariaDB, Oracle, SQL Server, and PostgreSQL database engines.

How to connect to AWS RDS MySQL via the command line?

To connect to an Amazon RDS MySQL instance from your local command line interface (CLI), run the following command:

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

You will need:

  • The MySQL client installed on your machine
  • The endpoint of your RDS instance
  • The port number to connect to AWS RDS MySQL
  • Your RDS username and password
How can I create stored procedures for MySQL in AWS RDS?

1. Connect to your RDS MySQL instance.

mysql -h your-endpoint -P 3306 -u your_username -p

Replace:

  • your_endpoint with your RDS endpoint (e.g., mydb.123456789012.us-east-1.rds.amazonaws.com)
  • your_username with your database username

2. Select your database.

USE your_database_name;

Replace your_database_name with the actual database name.

3. Create a stored procedure.

DELIMITER //

CREATE PROCEDURE GetAllUsers()
BEGIN
    SELECT * FROM users;
END //

DELIMITER ;

Replace GetAllUsers() and users with your procedure name and database table.

What are the benefits of Amazon RDS for MySQL?

AWS RDS provides the following advantages for MySQL:

  • Automated backup and recovery: you can customize the backup and recovery of a MySQL database instance at any point in time and within a specified retention period.
  • Easy deployments: in AWS RDS, it's possible to pre-configure settings and parameters for MySQL database instances and launch them just in a few clicks.
  • Security and isolation: AWS RDS provides the tools (VPC, KMS) that guarantee a high level of security for MySQL databases.
  • Monitoring: you can use Amazon CloudWatch metrics for your database instances with no extra charge. Additionally, AWS RDS Enhanced Monitoring allows you to access 50 CPU, memory, file system, and disk I/O metrics.
  • High availability and read replicas: AWS RDS Multi-AZ deployments present enhanced availability for database instances and RDS Read Replicas simplify flexible scaling beyond the capacity limitation of a database instance.
  • Storage: AWS RDS has two SSD-backed storage options for a MySQL database. If required, you can get additional storage with no downtime.
What are the limitations of Amazon RDS for MySQL?

You should know that you may face the following restrictions in AWS RDS for MySQL:

  • You cannot use InnoDB as the name of a MySQL database, table, or column, since it's a reserved word in RDS for MySQL.
  • If storage of a MySQL database instance is full, you can have metadata inconsistencies, dictionary mismatches, orphan tables, etc. To avoid these issues, AWS RDS automatically stops the instance with the storage-full state.
  • Currently, there is a bug in managing the InnoDB buffer pool size for MySQL v5.7. The value of the innodb_buffer_pool_size parameter can be set to a large value. This leads to the fact that the InnoDB buffer pool grows and uses much memory. Such an effect impacts negatively on the MySQL database engine. It can stop working or launching.
  • Also, there is a bug in the MySQL query optimizer for MySQL v5.5.37. You may get incorrect results if queries use index merge optimization.
  • AWS RDS does not support the MySQL keyring_aws Amazon Web Services Keyring Plugin.
  • AWS RDS has a case-sensitive file system. That's why you should keep your eye on some MySQL values, which you want to use, with the lower_case_table_names and long_query_time.
  • There is a size restriction on BLOBs written to the redo log for MySQL.
  • The maximum provisioned storage limit restricts the size of a table to a maximum size of 16 TB if you use InnoDB file-per-table tablespaces. Also, this limit constrains the system tablespace to a maximum size of 16 TB.

Articles about Amazon RDS

Data export from Amazon RDS for MySQL

This article can be useful for database administrators as it presents a walkthrough on how to export data quickly and easily by means of dbForge Studio for MySQL.

Import MySQL data into Amazon RDS

In this article, we provide a comprehensive step-by-step guide to importing data into Amazon RDS with the help of dbForge Studio for MySQL.

Conclusion

As you can see for yourself, it does not pose any difficulties to connect to Amazon RDS: the process is pretty quick and requires just several clicks. After you have deployed the database instance, you can start managing your database and making the necessary modifications. Note that with such a useful assistant as dbForge Studio for MySQL, you can create queries, measure and improve performance, compare data and schemas, and a lot more!

dbForge Studio for MySQL

The best IDE for effective MySQL database development

Availability in the editions of dbForge Studio for MySQL

Feature

Enterprise
Professional
Standard
Express
Compatibility with MySQL on Amazon RDS and Amazon Aurora
Yes
Yes
Yes
Yes