You are here

MySQL Configuration File sample (my.cnf/my.ini)

A good point to start with is also the templates at ./support-files/my-*.cnf

#
# my.cnf
#

[client]

prompt                        = "(\\u@\\h) [\\d]>\\_"


[mysqld]

# MyISAM

myisam_recover                = BACKUP,FORCE

# InnoDB

default_storage_engine        = InnoDB

# Binary logging

server_id                     = 1
log_bin                       = bin-log
sync_binlog                   = 1

# Logging

log-error                     = error.log
log_warnings                  = 2

general_log                   = 0
general_log_file              = general.log

slow_query_log                = 1
slow_query_log_file           = slow.log
log_queries_not_using_indexes = 1
long_query_time               = 1.0

# Security issues

local_infile                  = 0
secure_auth                   = 1
sql_mode                      = ANSI,ONLY_FULL_GROUP_BY
skip_name_resolve

MySQL enterprise grade configuration file

MySQL default configuration in my.cnf is not very enterprise grade aware. So some of the default values in my.cnf should be changed when you need it for business critical applications.

For reliability and compatibility it is recommended to use the following server variables:

variableshoulddefaultrelease
default_storage_engineInnoDBMyISAM
innodb_flush_log_at_trx_commit11
innodb_support_xa11> 5.0.2
local_infile01
log_bin10
log_error
log_queries_not_using_indexes10> 5.0.22
log_slow_queries
log_warnings21
long_query_time110
myisam_recoverBACKUP,FORCE
old_passwords00
prompt(\\u@\\h) [\\d]>\\_
secure_auth10
skip_name_resolveONOFF
sql_modeANSI,ONLY_FULL_GROUP_BY
sync_binlog10
sync_frm11