mercredi 26 août 2015

Importing sql file into AWS RDS

Currently I have an EC2 Instance and a RDS (mysql) instance. I exported my database from my local workstation and uploaded it to my EC2 instance and put it in my ec2-user home directory.

I log into the EC2 instance and run this command in the same directory as my projectname.sql file which in this case would be substituted for "backupfile.sql" in the command. After running this command my site was able to successfully connect to the database. I knew this because all my errors on my site disapeared. The issue now is that my tables did not seem to upload.

mysql -h host.address.for.rds.server -u rdsusername -p  rdsdatabase < backupfile.sql

Running this command:

mysql -h host.address.for.rds.server -P 3306 -u rdsusername -p

With my correct credentials logs me in to the rds server. I then run:

use databasename
show tables

But no tables are shown. My end goal is to get my localhost database onto AWS RDS by uploading a sql file. If there is an easier way please let me know!This is my first time setting up AWS and these road blocks are killing me.




Aucun commentaire:

Enregistrer un commentaire