1

I have a problem that I think it is something easy.

I want to connect to mysql database.

If I do the following:

mysql -uroot -premoved mydatabase
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

But if I do:

mysql -uroot -p mydatabase
Enter password: removed
mysql>

It works!! Why?

1
  • Does your actual password have any unusual characters in it? These might be interpolated by the shell. Commented Jan 30, 2013 at 19:08

1 Answer 1

1

You need single quotes around your password.

mysql -uroot '-pabc$def' mydatabase

See mysql password is messing up my dump for reference.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.