Specifying Program Options
237
Typically,
DATADIR
is
/usr/local/mysql/data
for a binary installation or
/usr/local/var
for
a source installation. Note that this is the data directory location that was specified at configuration
time, not the one specified with the
--datadir
[404]
option when
mysqld
starts. Use of
--
datadir
[404]
at runtime has no effect on where the server looks for option files, because it looks for
them before processing any options.
MySQL looks for option files in the order just described and reads any that exist. If an option file that
you want to use does not exist, create it with a plain text editor.
If multiple instances of a given option are found, the last instance takes precedence. There is one
exception: For
mysqld
, the first instance of the
--user
[424]
option is used as a security precaution,
to prevent a user specified in an option file from being overridden on the command line.
Note
On Unix platforms, MySQL ignores configuration files that are world-writable.
This is intentional as a security measure.
Any long option that may be given on the command line when running a MySQL program can be given
in an option file as well. To get the list of available options for a program, run it with the
--help
option.
The syntax for specifying options in an option file is similar to command-line syntax (see
Section 4.2.3.1, “Using Options on the Command Line”
). However, in an option file, you omit
the leading two dashes from the option name and you specify only one option per line. For
example,
--quick
and
--host=localhost
on the command line should be specified as
quick
and
host=localhost
on separate lines in an option file. To specify an option of the form
--
loose-opt_name
in an option file, write it as
loose-opt_name
.
Empty lines in option files are ignored. Nonempty lines can take any of the following forms:
•
#comment
,
;comment
Comment lines start with “
#
” or “
;
”. A “
#
” comment can start in the middle of a line as well.
•
[group]
group
is the name of the program or group for which you want to set options. After a group line, any
option-setting lines apply to the named group until the end of the option file or another group line is
given. Option group names are not case sensitive.
•
opt_name
This is equivalent to
--opt_name
on the command line.
•
opt_name=value
This is equivalent to
--opt_name=value
on the command line. In an option file, you can have
spaces around the “
=
” character, something that is not true on the command line. You can optionally
enclose the value within single quotation marks or double quotation marks, which is useful if the
value contains a “
#
” comment character.
Leading and trailing spaces are automatically deleted from option names and values.
You can use the escape sequences “
\b
”, “
\t
”, “
\n
”, “
\r
”, “
\\
”, and “
\s
” in option values to represent
the backspace, tab, newline, carriage return, backslash, and space characters. The escaping rules in
option files are:
• If a backslash is followed by a valid escape sequence character, the sequence is converted to the
character represented by the sequence. For example, “
\s
” is converted to a space.
• If a backslash is not followed by a valid escape sequence character, it remains unchanged. For
example, “
\S
” is retained as is.
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...