Skip navigation.
Home

Languages

RSS Feed FromDual on Linked In Recommend us on Xing Join us on Facebook Google+ Flickr Contact us

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:

variable should default release
default_storage_engine InnoDB MyISAM
innodb_flush_log_at_trx_commit 1 1
innodb_support_xa 1 1 > 5.0.2
local_infile 0 1
log_bin 1 0
log_error
log_queries_not_using_indexes 1 0 > 5.0.22
log_slow_queries
log_warnings 2 1
long_query_time 1 10
myisam_recover BACKUP,FORCE
old_passwords 0 0
prompt (\\u@\\h) [\\d]>\\_
secure_auth 1 0
skip_name_resolve ON OFF
sql_mode ANSI,ONLY_FULL_GROUP_BY
sync_binlog 1 0
sync_frm 1 1