Importing data into an Amazon RDS for MySQL DB instance - Amazon Relational Database Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Importing data into an Amazon RDS for MySQL DB instance

You can use several different techniques to import data into an RDS for MySQL DB instance. The best approach depends on a number of factors:

  • Source of the data

  • Amount of data

  • One-time import or ongoing

  • Amount of downtime

If you are also migrating an application with the data, the amount of downtime is important to consider.

The following table lists techniques to importing data into an RDS for MySQL DB instance:

Source Amount of data One time or ongoing Application downtime Technique More information

Existing MySQL database on premises or on Amazon EC2

Any

One time

Some

Create a backup of your on-premises database, store it on Amazon S3, and then restore the backup file to a new Amazon RDS DB instance running MySQL.

Restoring a backup into an Amazon RDS for MySQL DB instance

Existing MySQL database on premises or on Amazon EC2

Any

Ongoing

Minimal

Configure replication with an existing MySQL database as the replication source.

Configuring binary log file position replication with an external source instance

Importing data to an Amazon RDS for MySQL database with reduced downtime

Any existing database

Any

One time or ongoing

Minimal

Use Amazon Database Migration Service to migrate the database with minimal downtime and, for many database DB engines, continue ongoing replication.

What is Amazon Database Migration Service and Using a MySQL-compatible database as a target for Amazon DMS in the Amazon Database Migration Service User Guide

Existing MySQL DB instance

Any

One time or ongoing

Minimal

Create a read replica for ongoing replication. Promote the read replica for one-time creation of a new DB instance.

Working with DB instance read replicas

Existing MySQL database

Small

One time

Some

Copy the data directly to your MySQL DB instance using a command-line utility.

Importing data from an external MySQL database to an Amazon RDS for MySQL DB instance

Data not stored in an existing database

Medium

One time

Some

Create flat files and import them using MySQL LOAD DATA LOCAL INFILE statements.

Importing data from any source to an Amazon RDS for MySQL DB instance

Note

The mysql system database contains authentication and authorization information required to log in to your DB instance and access your data. Dropping, altering, renaming, or truncating tables, data, or other contents of the mysql database in your DB instance can result in error and might render the DB instance and your data inaccessible. If this occurs, you can restore the DB instance from a snapshot using the Amazon CLI restore-db-instance-from-db-snapshot command. You can recover the DB instance using the Amazon CLI restore-db-instance-to-point-in-time command.