Here, we’ve specified the username
saleh and the password tomcatIf specified in a configuration file, the leading dashes should be omitted. For example,
you
would write --user=saleh on the command line and user=saleh in an options file.
We’ll generally omit the leading dashes in our descriptions.
Many options also have a short form that can be used only from the command line.
For example, instead of writing
--user=saleh on the command line, you can
write the short form u saleh. To help you understand what each command does, we consistently use the long form of each option (where one exists).
Most of the command-line utilities we describe in this book have a help option that you can use to discover the command syntax, including any short forms. For example,
to learn about the options
to use for the mysql program, type
mysql --helpmysql Ver 14.12 Distrib 5.0.22, for pc-linux-gnu (i) using readline Copyright (C) 2002 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute
it under the GPL licenseUsage: mysql OPTIONS database, -help Display this help and exit.
-p, --password[=name]
Password to use when connecting to server. If password is not given it's asked from the tty.
-u, -username User for login if not current user.
We’ve shown only part of the output here. You can see that you can use the short form
-?
instead of help,
u in place of user, and pin place of password. The brackets indicate that a clause is optional for example, you can call the mysql program without any command-line options or database name.
Some options assume default values if you don’t specify anything. To avoid surprises,
you can always explicitly specify the values you want.
When a command
gets too long for the page, we show it on multiple lines, with each line ending with a backslash (
\
) symbol. For example, we might
show the previous command as mysql \Share with your friends: