mysql5.6 my.cnf

[client]
default-character-set=utf8
[mysqld]
basedir = /usr/local/mysql
datadir = /home/mysql/data
character-set-server=utf8
collation-server=utf8_general_ci
back_log = 300
max_connections = 5000
max_connect_errors = 300
table-definition-cache=2000
table-open-cache=4000
max_allowed_packet = 32M

max_heap_table_size = 128M
sort_buffer_size = 16M
join_buffer_size = 16M
thread_cache_size = 16
thread_concurrency = 8
query_cache_size = 128M
query_cache_limit = 4M
ft_min_word_len = 8
default-storage-engine=MYISAM
thread_stack = 512K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 128M
slow-query-log
long_query_time = 6

#master config
# grant replication slave, replication client on *.* to 'root'@'192.168.1.131' identified by 'password';
# ref : http://blog.csdn.net/seteor/article/details/17261733
server-id = 1
log-bin=mysql-bin
binlog_cache_size = 4M
binlog_format=mixed
expire_logs_days=3
binlog-ignore-db=test
replicate-ignore-db=test

#slave config
#server_id=2
#binlog-do-db = mydb
#binlog-ignore-db=test #不记录binlog
#replicate-ignore-db=test #不复制test库的binlog
#log-bin=mysql-bin
#binlog_cache_size = 1M
#binlog_format=mixed
#expire_logs_days=3

key_buffer_size = 128M
read_buffer_size = 8M
read_rnd_buffer_size = 64M
bulk_insert_buffer_size = 256M
myisam_sort_buffer_size = 256M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
skip-federated

#innodb config
innodb_additional_mem_pool_size = 64M
innodb_buffer_pool_size = 6G
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_io_threads = 4
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 16M
innodb_log_file_size = 512M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120

[mysqldump]
quick
max_allowed_packet = 32M
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 2048M
sort_buffer_size = 2048M
read_buffer = 32M
write_buffer = 32M
[myisamchk]
key_buffer = 2048M
sort_buffer_size = 2048M
read_buffer = 32M
write_buffer = 32M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
open-files-limit = 8192

猜你喜欢

转载自uzoice.iteye.com/blog/2161123