# MySQL5.6 configure file (PROD)
# MySQL_version 5.6
# Version 1.1
# Date 2017-02-17
[mysqld]
# generic configuration options
default-time-zone= "+8:00"
user = mysql
port = 3306
basedir =/usr/local/mysql
datadir =/data/mysql/mysql3306/data/
tmpdir =/data/mysql/mysql3306/tmp/
slave-load-tmpdir = /data/mysql/mysql3306/tmp/
socket =/data/mysql/mysql3306/data/mysql.sock
log-error =/data/mysql/mysql3306/data/error.log
pid-file =/data/mysql/mysql3306/data/mysql.pid
character-set-server = utf8
collation-server = utf8_bin
explicit_defaults_for_timestamp = 1
#sql_mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER"
#-----------------myisam---------------------------------------
key_buffer_size = 500M
myisam_max_sort_file_size = 1G
#myisam_recover
myisam_repair_threads = 1
myisam_sort_buffer_size = 500M
max_heap_table_size = 128M
tmp_table_size = 128M
join_buffer_size = 16M
read_buffer_size = 16M
read_rnd_buffer_size = 16M
sort_buffer_size = 16M
#----------------myisam end------------------------------------
#------------------innodb--------------------------------------
default-storage-engine = InnoDB
innodb_data_home_dir = /data/mysql/mysql3306/data/
innodb_log_group_home_dir = /data/mysql/mysql3306/data/
innodb_additional_mem_pool_size = 128M
innodb_buffer_pool_size = 4G
innodb_data_file_path = ibdata1:100M:autoextend
innodb_status_file = 1
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 1
sync_binlog = 1
innodb_io_capacity = 2000
innodb_lock_wait_timeout = 60
innodb_log_buffer_size = 32M
innodb_purge_threads = 4
innodb_log_files_in_group = 2
innodb_log_file_size = 1G
innodb_rollback_on_timeout
innodb_support_xa = 1
innodb_read_io_threads = 8
innodb_write_io_threads = 8
innodb_buffer_pool_instances = 4
innodb_buffer_pool_load_at_startup = 1
innodb_buffer_pool_dump_at_shutdown = 1
innodb_flush_neighbors = 1
innodb_undo_directory = /data/mysql/mysql3306/data/
innodb_undo_logs = 128
innodb_undo_tablespaces = 3
innodb_print_all_deadlocks = 1
#innodb_flush_neighbor_pages = 0
#------------------innodb end------------------------------------
#------------------- log-----------------------------------------
log-bin = /data/mysql/mysql3306/logs/mysql-bin
log-bin-index = /data/mysql/mysql3306/logs/mysql-bin.index
relay-log = /data/mysql/mysql3306/logs/relay-bin
relay-log-index = /data/mysql/mysql3306/logs/relay-bin.index
server-id = 10153306
binlog_cache_size = 64M
max_allowed_packet = 64M
max_binlog_cache_size = 4G
expire_logs_days = 60
log_warnings = 1
slow_query_log
slow_query_log_file = /data/mysql/mysql3306/logs/slow.log
log_queries_not_using_indexes = 1
log_slow_admin_statements = 1
log_slow_slave_statements = 1
log_throttle_queries_not_using_indexes = 10
long_query_time = 0.5
#--------------------log end-------------------------------------
#----------------------replication-------------------------------
master_info_repository = TABLE
relay_log_info_repository = TABLE
gtid_mode=on
enforce-gtid-consistency=on
log_slave_updates
binlog_format = row
relay_log_recovery = 1
binlog_gtid_simple_recovery = 1
slave_skip_errors = ddl_exist_errors
#--------------------replication end-----------------------------
#replicate-wild-ignore-table = mysql.%
#replicate-wild-ignore-table = performance_schema.%
group_concat_max_len = 1024
transaction_isolation = REPEATABLE-READ
#----------------qcache-------------------
query_cache_size = 0
query_cache_type = 0
#----------------qcache end---------------
skip-symbolic-links
skip-external-locking
skip-name-resolve
#skip-slave-start
back_log = 200
max_connections = 1000
max_user_connections = 800
max_connect_errors = 99999
open_files_limit = 65535
#wait_timeout = 1800
#interactive_timeout = 1800
lock_wait_timeout = 120
net_read_timeout = 120
net_write_timeout = 120
thread_cache_size = 300
#thread_concurrency = 32
#init_slave = 'set sql_mode = STRICT_ALL_TABLES'
local_infile = 1
ft_min_word_len = 1
#lower_case_table_names
table_open_cache = 1024
thread_stack = 256K
innodb_max_dirty_pages_pct = 70
innodb_flush_method = O_DIRECT
innodb_commit_concurrency=0
bulk_insert_buffer_size = 64M
[mysqldump]
quick
max_allowed_packet = 64M
[mysql]
no-auto-rehash
default-character-set = utf8
[isamchk]
key_buffer = 50M
sort_buffer_size = 50M
read_buffer = 8M
write_buffer = 8M
[myisamchk]
key_buffer = 50M
sort_buffer_size = 50M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout
[client]
port = 3306
MySQL-5.6配置文件(GTID)
最新推荐文章于 2021-03-17 19:18:17 发布