[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you need to specify startup options when you run the server, you can indicate them on the command line or place them in an option file. For options that will be used every time the server starts, you will find it most convenient to use an option file to specify your MySQL configuration. This is true particularly under the following circumstances:
InnoDB
transactional tables in
MySQL version 3.23, you
must manually create two new directories to hold the InnoDB
data and log files--such as, `C:\ibdata' and `C:\iblogs'.
You will also need to add some extra lines to the option
file, as described in InnoDB
start.
(As of MySQL 4.0, InnoDB creates its datafiles and log files in the data
directory by default. This means you need not configure InnoDB explicitly.
You may still do so if you wish, and an option file will be useful in this
case, too.)
On Windows, the MySQL installer places the data directory directly under the directory where you install MySQL. If you would like to use a data directory in a different location, you should copy the entire contents of the `data' directory to the new location. For example, by default, the installer places MySQL in `C:\mysql' and the data directory in `C:\mysql\data'. If you want to use a data directory of `E:\mydata', you must do two things:
--datadir
option to specify the new data directory location
each time you start the server.
When the MySQL server starts on Windows, it looks for options in
two files: The `my.ini' file in the Windows directory, and
the `C:\my.cnf' file. The Windows directory typically is
named something like `C:\WINDOWS' or `C:\WinNT'. You
can determine its exact location from the value of the WINDIR
environment variable using the following command:
C:\> echo %WINDIR% |
MySQL looks for options first in the `my.ini' file, then in
the `my.cnf' file. However, to avoid confusion, it's best if
you use only one file. If your PC uses a boot loader where the
C:
drive isn't the boot drive, your only option is to use
the `my.ini' file. Whichever one you use, it must be a plain
text file.
An option file can be created and modified with any text editor,
such as the Notepad
program. For example, if MySQL is
installed at `D:\mysql' and the data directory is located as
`D:\mydata\data', you can create the option file and set up
a [mysqld]
section to specify values for the basedir
and datadir
parameters:
[mysqld] # set basedir to your installation path basedir=D:/mysql # set datadir to the location of your data directory datadir=D:/mydata/data |
Note that Windows pathnames are specified in option files using forward slashes rather than backslashes. If you do use backslashes, you must double them.
Another way to manage an option file is to use the the WinMySQLAdmin
tool. You can find WinMySQLAdmin
in the `bin' directory
of your MySQL installation, as well as a help file containing
instructions for using it. WinMySQLAdmin
has the capability
of editing your option file, but note these points:
WinMySQLAdmin
uses only the `my.ini' file.
WinMySQLAdmin
finds a `C:\my.cnf' file, it will in fact rename
it to `C:\my_cnf.bak' to disable it.
Now you are ready to test starting the server.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |