Databases Reference
In-Depth Information
always specify one as we discuss in the section on server-wide options. Note that
Windows client programs do read in any existing options files.
Server-specific
Settings apply for the MySQL programs in a particular installation.
The default location for a server-specific options file is <MySQL_directory>/
my.cnf for Linux and Mac OS X, and <MySQL_directory>\my.ini for Windows.
The options file is sometimes placed in the data directory, but this is not recom-
mended for two reasons: first, it won't work if you don't use the default location
of data directory specified when the MySQL installation was compiled. Second,
the data directory must be readable by any client programs (and therefore by other
users on the system) that need to see the options file. It's better that access to the
data directory be limited to only the server, so it's best to keep the options file
elsewhere.
Under Windows, the MySQL installation process places a my.ini options file in the
MySQL directory. When MySQL is installed as a Windows service, the location of
this options file is also specified; a typical service entry is:
"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt"
--defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini"
If you want to use a different options file location, you'll need to change the service
entry. For example, you could ask your server to read in the options file
C:\my.cnf by specifying the service as:
"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt"
--defaults-file="C:\my.cnf"
If you want to start the server from the command line instead of using the Windows
service, you'll need to specify the path to the options file; you can use the same file
or a different one. For example, you could ask your server to read in the options
file C:\my.cnf as follows:
C:\> mysqld-nt --defaults-file="C:\my.cnf"
User-specific
Settings apply for the MySQL programs run by a particular user.
The default location of a user-specific options file on a Linux or Mac OS X system
is the file .my.cnf located in the user's home directory—that is, ~/.my.cnf . There is
currently no support for user-specific options files under Windows.
Search Order for Options Files
The MySQL server and client programs look for options files in the standard locations
and read them in order; values from later files take precedence over earlier ones. Op-
tions specified on the command line override values from options files.
 
Search WWH ::




Custom Search