Amazon RDS:如何将数据库导入亚马逊RDS实例?

I am using Amazon EC2 with Amazon RDS.

I have successfully created database and uploaded code to amazon using Elastic Beanstalk. Now I want to import my local databse data to RDS databse. I surf and found that by mysql command we can do that so I do this

D:\wamp\bin\mysql\mysql5.5.8\bin>mysql --host=myinstances.aa23swersdf.us-east-1.rds.amazonaws.com --user=username --pass=password --port=3306 dbname < locahost.sql

But it throws this error :

ERROR 2003 (HY000): Can't connect to MySQL server on 'myinstances.aa23swersdf.us-east-1.rds.amazonaws.com' (10060)

How can I solve it?

I have do this by cmd on windows.

Hope this helps.

  1. Make sure port 3306 is allowed on the Amazon EC2 Instance firewall.
  2. Add security group that allows port 3306
  3. On the mysql of both local and amazon, add the host myinstances.aa23swersdf.us-east-1.rds.amazonaws.com with your corresponding username and password.
  4. Flush privileges.

You can also used MySQL Connector to test. It is available to download at the Internet.

Have you added your IP Address to the security group.

Or you can install phpMyAdmin on one of the AWS instances, assign it to the security group and then run the import.