Specifying Program Options
238
The preceding rules mean that a literal backslash can be given as “
\\
”, or as “
\
” if it is not followed by
a valid escape sequence character.
The rules for escape sequences in option files differ slightly from the rules for escape sequences in
string literals in SQL statements. In the latter context, if “
x
” is not a value escape sequence character,
“
\x
” becomes “
x
” rather than “
\x
”. See
Section 9.1.1, “String Literals”
.
The escaping rules for option file values are especially pertinent for Windows path names, which use
“
\
” as a path name separator. A separator in a Windows path name must be written as “
\\
” if it is
followed by an escape sequence character. It can be written as “
\\
” or “
\
” if it is not. Alternatively, “
/
”
may be used in Windows path names and will be treated as “
\
”. Suppose that you want to specify a
base directory of
C:\Program Files\MySQL\MySQL Server 5.0
in an option file. This can be
done several ways. Some examples:
basedir="C:\Program Files\MySQL\MySQL Server 5.0"
basedir="C:\\Program Files\\MySQL\\MySQL Server 5.0"
basedir="C:/Program Files/MySQL/MySQL Server 5.0"
basedir=C:\\Program\sFiles\\MySQL\\MySQL\sServer\s5.0
If an option group name is the same as a program name, options in the group apply specifically to
that program. For example, the
[mysqld]
and
[mysql]
groups apply to the
mysqld
server and the
mysql
client program, respectively.
The
[client]
option group is read by all client programs (but not by
mysqld
). This enables you to
specify options that apply to all clients. For example,
[client]
is the perfect group to use to specify
the password that you use to connect to the server. (But make sure that the option file is readable and
writable only by yourself, so that other people cannot find out your password.) Be sure not to put an
option in the
[client]
group unless it is recognized by all client programs that you use. Programs
that do not understand the option quit after displaying an error message if you try to run them.
Here is a typical global option file:
[client]
port=3306
socket=/tmp/mysql.sock
[mysqld]
port=3306
socket=/tmp/mysql.sock
key_buffer_size=16M
max_allowed_packet=8M
[mysqldump]
quick
The preceding option file uses
var_name=value
syntax for the lines that set the
key_buffer_size
[458]
and
max_allowed_packet
[466]
variables.
Here is a typical user option file:
[client]
# The following password will be sent to all standard MySQL clients
password="my_password"
[mysql]
no-auto-rehash
connect_timeout=2
[mysqlhotcopy]
interactive-timeout
If you want to create option groups that should be read by
mysqld
servers from a specific MySQL
release series only, you can do this by using groups with names of
[mysqld-4.1]
,
[mysqld-5.0]
,
and so forth. The following group indicates that the
--new
option should be used only by MySQL
servers with 5.0.x version numbers:
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 ...