#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /tmp/mysql.sock
loose-default-character-set=utf8
#default-character-set = utf8
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /tmp/mysql.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
#
# * IMPORTANT
# If you make changes to these settings and your system uses apparmor, you may
# also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#
character-set-server = utf8
user = mysql
socket = /tmp/mysql.sock
port = 3306
basedir = /usr/local/mysql
datadir = /data1/mysql
tmpdir = /tmp
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 0.0.0.0
wait_timeout = 31536000
interactive_timeout = 31536000
skip-name-resolve
back_log = 500
max_connections = 500
max_connect_errors = 10
#external-locking
table_cache = 512
max_allowed_packet = 16M
binlog_cache_size = 128M
max_heap_table_size = 64M
sort_buffer_size = 512M
join_buffer_size = 512M
thread_cache_size = 8
thread_concurrency = 16
query_cache_size =128M
query_cache_limit = 512M
ft_min_word_len = 4
#memlock
default_table_type = innodb
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 256M
#log
log_warnings
log_error = /var/log/mysql/error.log
log-short-format
slow_query_log = 1
slow_query_log_file = /data1/logs/mysql-slow.log
long_query_time = 0.5
log-queries-not-using-indexes
tmpdir = /tmp
#*** MyISAM Specific options
key_buffer_size = 512M
read_buffer_size = 512M
read_rnd_buffer_size = 512M
bulk_insert_buffer_size = 128M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
# Here you can see queries with especially long duration
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
server-id = 2
log_bin = mysql-bin.log
binlog_format = mixed
#master-host=192.168.172.3
#master-user=replication
#master-password=123456
#master-port=3306
slave-skip-errors=all
#slave-skip-errors=1062,1053,1452
expire_logs_days = 10
max_binlog_size = 100M
# *** INNODB Specific options ***
#skip-innodb
innodb_additional_mem_pool_size = 64M
innodb_buffer_pool_size = 1024m
innodb_autoextend_increment = 256m
innodb_data_file_path = ibdata1:1000M:autoextend
innodb_read_io_threads = 8
innodb_write_io_threads = 4
#innodb_force_recovery = 1
innodb_thread_concurrency = 8
innodb_flush_log_at_trx_commit = 0
#innodb_fast_shutdown
innodb_log_buffer_size = 128M
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
#innodb_log_group_home_dir
innodb_max_dirty_pages_pct = 90
innodb_flush_method = O_DSYNC
innodb_lock_wait_timeout = 120
innodb_support_xa = 0
# *** Percona Patches options ***
# http://www.percona.com/docs/wiki/patches:start
#innodb_show_verbose_locks
#innodb_show_locks_held
#userstat_running
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
mysql 配置文件
猜你喜欢
转载自san-yun.iteye.com/blog/1851924
今日推荐
周排行