I wrote a batch file which establishing the connection to linux server which I am able to do so, after this I am trying to take the mysqldump to some certain directory, it has all 777 permissions but linux system ask me to "Enter Password" which is nothing but empty, and manually I need to press Enter, I just need to execute my script which just press Enter so that execution will happen automatically. Below are some details.

batch file:

plink.exe -ssh user@host -m command.txt


mysqldump -uve -p -R -E --single-transaction --databases mydb|gzip > /home/user/mydb_bkup.gz

This is the image which is prompting me to enter password: this is the image which is prompting me to enter password

Please provide me some inputs so that I can enter the password and execute my command automatically.


As far as I understand you, it's the command you're running that asks for password. Your line is:

mysqldump -uve -p -R -E --single-transaction --databases mydb|gzip > /home/user/mydb_bkup.gz

If we head over to man mysql, we read the following:

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, mysql prompts for one.

You have not specified anything - because the shell threats space as an argument separator. Either set a password for the mysql user, remove -p from the command.txt file, or... modify your command to the following:

mysqldump -uve --password="" -R -E --single-transaction --databases mydb|gzip > /home/user/mydb_bkup.gz

Here we explicitly specify a blank password.

| improve this answer | |
  • This syntax mysqldump -u'user-name' -p'the-password' ... is also applicable. – pa4080 Feb 11 '18 at 16:33
  • Oh, I was not aware that -p'' would work. Thanks for the information :) – vidarlo Feb 11 '18 at 19:36
  • You can also just write the password straight after -p so something like this -pY0ur_PaSSW0Rd_9o3s_H3R3 – 3kstc Apr 1 '19 at 7:19

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.