Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using the following command:

mysqldump -alv -h 123.123.123.123 --password=P@ssw0rd --user=UsernameHere --add-drop-table -p DatabaseSchemaName > dump.sql

Then it asks me to Enter Password. Is there I'm doing wrong when specifying the password in the command?

The password I'm entering is definitely the proper password.

share|improve this question
5  
Look at your statement again. See that -p at the end? That's the password switch. You're overriding your original password switch on the far left because of it. (Because it's blank, it's also asking for a password) –  qweet Mar 5 '12 at 17:11
1  
DOH! Didn't see that thing slip in there... Reply with a proper answer and I'll give you credit. Thanks! –  Jakobud Mar 5 '12 at 17:16

1 Answer 1

man mysqldump:

--password[=password], -p[password]

The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, you are prompted for one.
Specifying a password on the command line should be considered insecure. See Section 6.6, "Keeping Your Password Secure".

You have two password arguments:

mysqldump -alv -h 123.123.123.123 --password=P@ssw0rd --user=UsernameHere --add-drop-table -p DatabaseSchemaName > dump.sql

Remove that last argument and it should work fine.

share|improve this answer
    
Yeah qweet pointed that out to me above. Not sure how that slipped in there. Thanks –  Jakobud Mar 5 '12 at 17:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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