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-specificSettings apply for the MySQL programs in a particular installation.
The default location fora server-specific
options file is /my.cnf for Linux and Mac OS X, and
\my.ini for Windows.
The options file is sometimes
placed in the data directory, but this is not recommended 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 seethe 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 theMySQL directory. When MySQL is installed as a Windows service, the location of this options file is also specified atypical 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 fileC:\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-specificSettings 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.
Share with your friends: