I'm trying to upload a sql file to mysql on AWS using my shell terminal. I can login fine and everything works great. I used FTP to transfer a sql file to my html folder and I'm trying to import it to an already existing mysql database using the following command:

sudo mysql -u ubuntu -p dbasename < /var/www/html/nameoffile.sql

But when I run this command I get the following error:

ERROR 1045 (28000): Access denied for user 'ubuntu'@'localhost' (using password: YES)

Anyone know what this means?

  • This might help stackoverflow.com/questions/10299148/… and please use google before posting a question. Thank you. – rɑːdʒɑ Sep 22 '15 at 22:56
  • @Raja yes, that worked thank you. I did look on Google first but I guess I didn't know what I was looking for exactly. Thank you. – Sage Sep 22 '15 at 23:14
  • Glad you got solved your issue , I just googled your error code. Please close the question. – rɑːdʒɑ Sep 22 '15 at 23:15

See @Raja answer above. It's a simple matter of remembering to use the MySQL USER and not the OS user for the operation (in my case). Although the link given has many other things to consider as well if you're having this problem.

Raja if you want to add an answer as well I'll change mine to yours, or if it's desired to just delete this altogether I get that too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.