AlwaysALearner
AlwaysALearner

Reputation: 6690

Skip MySQL password

I am executing this command-

mysql -u user1 -p password1 -e "show databases"

and I expect to run the mysql "show databases" command successfully. But It's not happening that way. It's asking for password again, even though I've entered the correct password. This is what I get-

Enter password:

How can I get rid of this prompt where it asks for password even though I've given in my command?

Upvotes: 1

Views: 144

Answers (1)

Karan Punamiya
Karan Punamiya

Reputation: 8863

Don't put a space after -p

mysql -u user1 -ppassword1 -e "show databases"

Upvotes: 5

Related Questions