Specifying Program Options
240
•
--defaults-file=file_name
[240]
Use only the given option file. If the file does not exist or is otherwise inaccessible, the program exits
with an error.
file_name
is the full path name to the file.
•
--defaults-group-suffix=str
[240]
If this option is given, the program reads not only its usual option groups, but also groups with the
usual names and a suffix of
str
. For example, the
mysql
client normally reads the
[client]
and
[mysql]
groups. If the
--defaults-group-suffix=_other
[240]
option is given,
mysql
also reads the
[client_other]
and
[mysql_other]
groups. This option was added in MySQL
5.0.10.
•
--no-defaults
[240]
Do not read any option files. If a program does not start because it is reading unknown options from
an option file,
--no-defaults
[240]
can be used to prevent the program from reading them.
•
--print-defaults
[240]
Print the program name and all options that it gets from option files.
4.2.3.5. Using Options to Set Program Variables
Many MySQL programs have internal variables that can be set at runtime using the
SET
statement.
See
Section 13.7.4, “
SET
Syntax”
, and
Section 5.1.5, “Using System Variables”
.
Most of these program variables also can be set at server startup by using the same syntax that
applies to specifying program options. For example,
mysql
has a
max_allowed_packet
variable that
controls the maximum size of its communication buffer. To set the
max_allowed_packet
variable for
mysql
to a value of 16MB, use either of the following commands:
shell>
mysql --max_allowed_packet=16777216
shell>
mysql --max_allowed_packet=16M
The first command specifies the value in bytes. The second specifies the value in megabytes. For
variables that take a numeric value, the value can be given with a suffix of
K
,
M
, or
G
(either uppercase
or lowercase) to indicate a multiplier of 1024, 1024
2
or 1024
3
. (For example, when used to set
max_allowed_packet
, the suffixes indicate units of kilobytes, megabytes, or gigabytes.)
In an option file, variable settings are given without the leading dashes:
[mysql]
max_allowed_packet=16777216
Or:
[mysql]
max_allowed_packet=16M
If you like, underscores in a variable name can be specified as dashes. The following option groups are
equivalent. Both set the size of the server's key buffer to 512MB:
[mysqld]
key_buffer_size=512M
[mysqld]
key-buffer-size=512M
A variable can be specified by writing it in full or as any unambiguous prefix. For example, the
max_allowed_packet
variable can be set for
mysql
as
--max_a
, but not as
--max
because the
latter is ambiguous:
shell>
mysql --max=1000000
mysql: ambiguous option '--max=1000000' (max_allowed_packet, max_join_size)
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...