0

I recently created an MySQL instance on Amazon RDS. Unfortunately, I'm not able to connect to the instance from the MySQL command line. I will brief you the details.

1) I want to move/migrate my MySQL database from local machine to this RDS instance.

I did a bit of searching in stackoverflow & found few links.

https://stackoverflow.com/questions/11731714/how-do-i-import-a-local-mysql-db-to-rds-db-instance

https://stackoverflow.com/questions/18565634/how-to-import-mysql-dump-into-amazon-rds?rq=1

http://trisummittechnologies.com/importing-mysql-data-into-rds/

https://stackoverflow.com/questions/11769605/php-site-not-connecting-to-mysql-on-amazon-rds

2) I have an RDS instance with the following details.

Endpoint: end.awsabc.com
My RDS db master username: iammaster.
I don't know the password.
RDS db name: rdsdb
local machine db name: localdb
name of SQLdump file of localdb: localdump.sql

3) These are the commands that I used in command prompt:

mysql -h end.awsabc.com -u iammaster-p rdsdb< D:\localdump.sql
ERROR 2003: Cannot connect to MySQL server on abcdtrash.rds.com

Then I tried another method: This is the command I typed in the command prompt:

C:\wamp\bin\mysql\mysql5.6.17\bin>mysqldump -u root localdb| mysql --host=end.awsabc.com --user=iammaster rdsdb
Error: Access denied.

Is this because I don't have a password?? Can anyone tell me how to accomplish the task?

asked May 29, 2014 at 4:12
4
  • It may help answerers if you say which software versions are involved. Commented May 29, 2014 at 5:43
  • Software versions??? What software versions? I am trying via command line. I use MySQL 5.6.17 @ Michael Green Commented May 29, 2014 at 9:32
  • There you go - that software version. Commented May 29, 2014 at 10:17
  • If you don't know the password for the RDS database, how were you expecting to get in? Commented Jun 2, 2014 at 16:18

1 Answer 1

0

I prefer using MySQL workbench. It's much more easier & user friendly than the command line way.

It provides a simple GUI.

MySQL workbench or SQL Yog.

These are the steps that I did:

  1. Install MySQL Workbench.
  2. In AWS console, there must be a security group for your RDS instance. Add an inbound rule to that group for allowing connections from your machine. It's simple. Add your IP-address.
  3. Open MySQL workbench, Add a new connection.
  4. Give the connection a name you prefer.
  5. Choose connection method- Standard TCP/IP
  6. Enter your RDS endpoint in the field of Hostname.
  7. Port:3306
  8. Username: master username (the one which which you created during the creation of your RDS instance)
  9. Password: master password
  10. Click Test Connection to check your connection.
  11. If connection is successful, click OK.
  12. Open the connection.
  13. you will see your database there.
  14. Now you can export your mysqldump file to this database. Go to-> Server. Click Data Import.
  15. You can check whether the data has been migrated by simply opening a blank SQL file & typing in basic SQL commands like use database, select * from table;

That's it. Viola.

Marco
3,7205 gold badges25 silver badges31 bronze badges
answered Jun 4, 2014 at 4:29

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.