Oracle 5.0 Reference Manual page 261

Table of Contents

Advertisement

Be aware that the use of variable prefixes can cause problems in the event that new variables are
implemented for a program. A prefix that is unambiguous now might become ambiguous in the future.
Suffixes for specifying a value multiplier can be used when setting a variable at server startup, but not
to set the value with
using an expression, which is not true when you set a variable at server startup. For example, the first
of the following lines is legal at server startup, but the second is not:
shell>
mysql --max_allowed_packet=16M
shell>
mysql --max_allowed_packet=16*1024*1024
Conversely, the second of the following lines is legal at runtime, but the first is not:
mysql>
SET GLOBAL max_allowed_packet=16M;
mysql>
SET GLOBAL max_allowed_packet=16*1024*1024;
4.2.3.6. Option Defaults, Options Expecting Values, and the
By convention, long forms of options that assign a value are written with an equals (=) sign, like this:
shell>
mysql --host=tonfisk --user=jon
For options that require a value (that is, not having a default value), the equal sign is not required, and
so the following is also valid:
shell>
mysql --host tonfisk --user jon
In both cases, the
"tonfisk" using an account with the user name "jon".
Due to this behavior, problems can occasionally arise when no value is provided for an option that
expects one. Consider the following example, where a user connects to a MySQL server running on
host
tonfisk
shell>
mysql --host 85.224.35.45 --user jon
Welcome to the MySQL monitor.
Your MySQL connection id is 3
Server version: 5.0.96 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
SELECT CURRENT_USER();
+----------------+
| CURRENT_USER() |
+----------------+
| jon@%
+----------------+
1 row in set (0.00 sec)
Omitting the required value for one of these option yields an error, such as the one shown here:
shell>
mysql --host 85.224.35.45 --user
mysql: option '--user' requires an argument
In this case,
came after it on the command line. However, if you omit the value for an option that is not the last
option to be used, you obtain a different error that you may not be expecting:
Specifying Program Options
at runtime. On the other hand, with
SET
Note
Before MySQL 4.0.2, the only syntax for setting program variables was
variable=option=value
files). Underscores cannot be given as dashes, and the variable name must
be specified in full. This syntax still is recognized, but is now deprecated and is
removed in MySQL 5.5.
client attempts to connect to a MySQL server running on the host named
mysql
as user jon:
Commands end with ; or \g.
|
was unable to find a value following the
mysql
you can assign a variable's value
SET
(or
set-variable=option=value
=
--user
241
--set-
in option
Sign
[232]
option because nothing

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents