Specifying Program Options
236
On Windows, MySQL programs read startup options from the following files, in the specified order (top
items are used first).
File Name
Purpose
%WINDIR%\my.ini
,
%WINDIR%\my.cnf
Global options
C:\my.ini
,
C:\my.cnf
Global options
INSTALLDIR\my.ini
,
INSTALLDIR\my.cnf
Global options
defaults-extra-file
The file specified with
--defaults-extra-file=path
[239]
, if
any
%WINDIR%
represents the location of your Windows directory. This is commonly
C:\WINDOWS
. You
can determine its exact location from the value of the
WINDIR
environment variable using the following
command:
C:\>
echo %WINDIR%
INSTALLDIR
represents the MySQL installation directory. This is typically
C:\PROGRAMDIR\MySQL
\MySQL 5.0 Server
where
PROGRAMDIR
represents the programs directory (usually
Program
Files
on English-language versions of Windows), when MySQL 5.0 has been installed using the
installation and configuration wizards. See
Section 2.10.3.1, “Starting the MySQL Server Instance
Configuration Wizard”
.
On Unix, Linux and Mac OS X, MySQL programs read startup options from the following files, in the
specified order (top items are used first).
File Name
Purpose
/etc/my.cnf
Global options
SYSCONFDIR/my.cnf
Global options
$MYSQL_HOME/my.cnf
Server-specific options
defaults-extra-file
The file specified with
--defaults-extra-file=path
[239]
, if
any
~/.my.cnf
User-specific options
~
represents the current user's home directory (the value of
$HOME
).
SYSCONFDIR
represents the directory specified with the
--sysconfdir
option to
configure
when MySQL was built. By default, this is the
etc
directory located under the compiled-in installation
directory. This location is used as of MySQL 5.0.21. (From 5.0.21 to 5.0.53, it was read last, after
~/.my.cnf
.)
MYSQL_HOME
is an environment variable containing the path to the directory in which the server-
specific
my.cnf
file resides. (This was
DATADIR
prior to MySQL version 5.0.3.)
If
MYSQL_HOME
is not set and you start the server using the
mysqld_safe
program,
mysqld_safe
attempts to set
MYSQL_HOME
as follows:
• Let
BASEDIR
and
DATADIR
represent the path names of the MySQL base directory and data
directory, respectively.
• If there is a
my.cnf
file in
DATADIR
but not in
BASEDIR
,
mysqld_safe
sets
MYSQL_HOME
to
DATADIR
.
• Otherwise, if
MYSQL_HOME
is not set and there is no
my.cnf
file in
DATADIR
,
mysqld_safe
sets
MYSQL_HOME
to
BASEDIR
.
In MySQL 5.0, use of
DATADIR
as the location for
my.cnf
is deprecated.
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 ...