Oracle 5.0 Reference Manual page 254

Table of Contents

Advertisement

password=pass_val
given), the program prompts you for the password. The password option also may be given in short
form as
-ppass_val
follow the option letter with no intervening space. The reason for this is that if a space follows the
option letter, the program has no way to tell whether a following argument is supposed to be the
password value or some other kind of argument. Consequently, the following two commands have
two completely different meanings:
shell>
mysql -ptest
shell>
mysql -p test
The first command instructs
database. The second instructs
default database.
• Within option names, dash ("-") and underscore ("_") may be used interchangeably. For example,
skip-grant-tables
leading dashes cannot be given as underscores.)
• For options that take a numeric value, the value can be given with a suffix of K, M, or
uppercase or lowercase) to indicate a multiplier of 1024, 1024
command tells
mysqladmin
mysql>
mysqladmin --count=1K --sleep=10 ping
Option values that contain spaces must be quoted when given on the command line. For example,
the
[266]
(or -e) option can be used with
--execute
When this option is used,
must be enclosed by quotation marks. For example, you can use the following command to obtain a list
of user accounts:
mysql>
mysql -u root -p --execute="SELECT User, Host FROM mysql.user"
Enter password:
******
+------+-----------+
| User | Host
|
+------+-----------+
|
| gigan
|
| root | gigan
|
|
| localhost |
| jon
| localhost |
| root | localhost |
+------+-----------+
shell>
Note that the long form
If you wish to use quoted values within a statement, you will either need to escape the inner quotation
marks, or use a different type of quotation marks within the statement from those used to quote the
statement itself. The capabilities of your command processor dictate your choices for whether you can
use single or double quotation marks and the syntax for escaping quote characters. For example, if
your command processor supports quoting with single or double quotation marks, you can use double
quotation marks around the statement, and single quotation marks for any quoted values within the
statement.
Multiple SQL statements may be passed in the option value on the command line, separated by
semicolons:
shell>
mysql -u root -p -e "SELECT VERSION();SELECT NOW()"
Enter password:
******
+------------+
| VERSION()
|
+------------+
| 5.0.19-log |
+------------+
+---------------------+
Specifying Program Options
[231]
or as
--password
or as -p. However, for the short form, if the password value is given, it must
to use a password value of test, but specifies no default
mysql
to prompt for the password value and to use
mysql
[420]
and
--skip_grant_tables
to ping the server 1024 times, sleeping 10 seconds between each ping:
executes the statements in the option value and exits. The statements
mysql
(--execute
[266]) is followed by an equal sign (=).
234
[231]. In the latter case (with no password value
[420]
are equivalent. (However, the
2
3
or 1024
to pass SQL statements to the server.
mysql
as the
test
(either
G
. For example, the following
--

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents