How do I import a local MySQL db to RDS db instance?

Viewed 57340

I've created a RDS instance called realcardiodb (the engine is mysql) and I've exported my database from my localhost. File is saved locally called localhostrealcardio.sql

Most research says to use mysqldump to import data from a local system to a web server, but my system doesn't even recognize mysqldump.

C:\xampp\mysql>mysqldump
'mysqldump' is not recognized as an internal or external command, operable program or batch   file. 

How do I resolve this error should I use mysqldump? (I definitely have mysql install on my system)

Is there a better utility I should use?

Any help is appreciated, especially if you have experience importing mysql to aws rds.

Thanks! DK

Update 7/31/2012 So I got the error resolved. mysqldump is in the bin directory C:\xampp\mysql\bin>mysqldump AWS provides the folloinwg instructions for uploading a local database to RDS:

mysqldump acme | mysql --host=hostname --user=username --password acme

Can someone break this down for me?

1) Is the first 'acme' (after mysqldump command) the name of my local database or the exported sql file I saved locally?

2)Is the hostname the IP address, Public DNS, RDS Endpoint or neither?

3)The username and password I assume is the RDS credentials and the second acme is the name of the database I created in RDS.

Thanks!

6 Answers

Using work bench :

  1. setup connection

  2. go to management tab and click on data import/restore

  3. click on import from self contained file .

  4. choose your mysqlbackup.sql file.

  5. select default database.

  6. click on start import button.

Using command line (On Windows ) :

mysqldump -u <localuser>

--databases world 
--single-transaction 
--compress 
--order-by-primary  
-p<localpassword> | mysql -u <rds-user-name>
    --port=3306 
    --host=ednpoint 
    -p<rds-password>

For more detail please refer : https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.SmallExisting.html or https://docs.bitnami.com/aws/how-to/migrate-database-rds/#using-phpmyadmin-110

Hope it helps.

The step by step instruction on how to migrate already existing db on mysql/mariadb to already running RDS instance.

Here is the AWS RDS Mysql document to import customer data into RDS

http://aws.amazon.com/articles/2933

  • Create flat files containing the data to be loaded
  • Stop any applications accessing the target DB Instance
  • Create a DB Snapshot
  • Disable Amazon RDS automated backups
  • Load the data using mysqlimport
  • Enable automated backups again
Related