简体   繁体   中英

Short- vs. long arguments passed to mysqldump.exe

I have example command:

mysqldump.exe --user=ABCabc --password=ABCabc --host=ABCabc --port=ABCabc ABCabc> "D:\ABCabc.sql"

but I know same can be written as:

mysqldump -uABCabc -pABCabc -hABCabc -pABCabc ABCabc> "D:\ABCabc.sql"

First comand works but second give me error unknown host. How can I fix it? Where I can learn about rules notation used in the windows comand line?

How to distinguish port to password?

There is no general answer here. This has nothing to do with CMD (the standard Windows command shell). The syntax is set by the tool you call (here mysqldump.exe ).

You should have a look at the documentation (as @Stephan pointed out in his comment).

Given your command line:

mysqldump.exe --user=ABCabc --password=ABCabc --host=ABCabc --port=ABCabc ABCabc

The proper usage of short options would be (note especially the upper case P as a shorthand option for password ):

mysqldump.exe -u ABCabc -p ABCabc -h ABCabc -P ABCabc ABCabc

I elided the output redirection ( > D:\\... ) because that is indeed the shell's (CMD) business and has in turn nothing to do with the specifics of mysqldump.exe .

Again, how did I know that? Not because there is a general pattern here [1], but simply because I read the documentation for the tool/application in question.

[1] Having that said, there are indeed conventions for command line arguments, here it looks like GNU getopt , but it doesn't have to be that way for every application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM