5.1.2.1. Changes to Server Defaults
Beginning with MySQL 5.6.6, several MySQL Server parameter defaults differ from the defaults in previous releases. The motivation for these changes is to provide better out-of-box performance and to reduce the need for database administrators to change settings manually.
In some cases, a parameter has a different fixed default value. In other cases, the server autosizes a parameter at startup using a formula based on other related parameters or server host configuration, rather than using a fixed value. For example, the setting for back_log is its previous default of 50, adjusted up by an amount proportional to the value of max_connections. The idea behind autosizing is that when the server has information available to make a decision about a parameter setting likely to be better than a fixed default, it will.
The following table summarizes changes to defaults. The Version column indicates when each default changed. For variables that are autosized, the main variable description provides additional detail about the sizing algorithm. See Section 5.1.4, “Server System Variables”, and Section 14.2.6, “InnoDB Startup Options and System Variables”. Any of these default settings can be overridden by specifying an explicit value at server startup.
In MySQL 5.6.6, the default for innodb_checksum_algorithm was changed from INNODB to CRC32. For compatibility reasons, the default was returned in 5.6.7 to INNODB.
5.1.2.2. Using a Sample Default Server Configuration File
As of MySQL 5.6.8, on Unix platforms,creates a default option file namedmy.cnfin the base installation directory. This file is created from a template included in the distribution package namedmy-default.cnf. You can find the template in or under the base installation directory. When started usingmysqld_safe, the server usesmy.cnffile by default. Ifmy.cnfalready exists,assumes it to be in use and writes a new file namedmy-new.cnfinstead.
With one exception, the settings in the default option file are commented and have no effect. The exception is that the file changes thesystem variable from its default of
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
This setting produces a server configuration that results in errors rather than warnings for bad data in operations that modify transactional tables. See
Themy-default.cnftemplate replaces the older sample option files formerly supplied with MySQL distributions (my-small.cnf,my-medium.cnf,my-large.cnf, andmy-huge.cnf). As of MySQL 5.6.8, these older files are no longer distributed.
On Windows, MySQL Installer interacts with the user and creates a file namedmy.iniin the base installation directory as the default option file. If you install on Windows from a Zip archive, you can copy themy-default.initemplate file in the base installation directory tomy.iniand use the latter as the default option file.
Note
On Windows, the.inior.cnfoption file extension might not be displayed.
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 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
Before MySQL 5.6.8, MySQL distributions include several sample option files that can be used as a basis for tuning the MySQL server. Look for files namedmy-small.cnf,my-medium.cnf,my-large.cnf, andmy-huge.cnf, which are sample files for small, medium, large, and very large systems. On Windows, the extension is.inirather than.cnf.
For a binary distribution, look for the sample files in or under your installation directory. If you have a source distribution, look in thesupport-filesdirectory. To use a sample file as a base configuration file, rename a copy of it and place the copy in the appropriate location. Regarding names and appropriate location, see the general information provided in