The MySQL server has many operating parameters, which you can change at server startup using command-line options or configuration files (option files). It is also possible to change many parameters at runtime. For general instructions on setting parameters at startup or runtime, see Section 6.1.4, “Server Command Options”, and Section 6.1.5, “Server System Variables”.
Before MySQL 5.7.5, on Unix platforms,
mysql_install_db creates a default option file
my.cnf in the base installation
directory. This file is created from a template included in the
distribution package named
You can find the template in or under the base installation
directory. When started using mysqld_safe, the
my.cnf file by default. If
my.cnf already exists,
mysql_install_db assumes it to be in use and
writes a new file named
With one exception, the settings in the default option file are
commented and have no effect. The exception is that the file sets
sql_mode system variable to
This setting produces a server configuration that results in
errors rather than warnings for bad data in operations that modify
transactional tables. See Section 6.1.8, “Server SQL Modes”.
On Windows, MySQL Installer interacts with the user and creates a
my.ini in the base installation
directory as the default option file. If you install on Windows
from a Zip archive, you can copy the
my-default.ini template file in the base
installation directory to
my.ini and use the
latter as the default option file.
On Windows, the
.cnf option file extension might not be
On any platform, after completing the installation process, you
can edit the default option file at any time to modify the
parameters used by the server. For example, to use a parameter
setting in the file that is commented with a
character at the beginning of the line, remove the
#, and modify the parameter value if necessary.
To disable a setting, either add a
# to the
beginning of the line or remove it.
For additional information about option file format and syntax, see Section 5.2.6, “Using Option Files”.