根据inside君的配置文件整理而来。

[mysql]
port            = 3306
socket          = /data/mysql/3306/mysql_3306.sock
default-character-set=utf8
prompt = [\\u@\\h][\\d]>\\_

[mysqld]
# basic settings #
user=nobody                  #调整为实际user
sql_mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER"
autocommit = 1
character_set_server=utf8
transaction_isolation = READ-COMMITTED
explicit_defaults_for_timestamp = 1
max_allowed_packet = 16M
event_scheduler = 1
server-id = 123383306        #在主从环境中需要调整
datadir=/data/mysql/3306     #调整为实际的数据目录

default_storage_engine=InnoDB
lower_case_table_names = 1

federated
port            = 3306
socket          = /data/mysql/3306/mysql_3306.sock
back_log = 150
bulk_insert_buffer_size = 64M
max_heap_table_size = 64M

# connection #
interactive_timeout = 1800
wait_timeout = 1800
lock_wait_timeout = 1800
skip_name_resolve = 1
max_connections = 3000
max_connect_errors = 100000

# session memory setting #
read_buffer_size = 16M
read_rnd_buffer_size = 32M
sort_buffer_size = 32M
tmp_table_size = 64M
join_buffer_size = 128M

###***thread_buffers***
table_open_cache = 2048
thread_cache_size = 8
thread_stack = 192K
query_cache_size = 512M
query_cache_limit = 2M


###***binlog parameters***
log_error = /data/mysql/3306/error.log
slow_query_log=1
slow_query_log_file = /data/mysql/3306/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
expire_logs_days       = 7
long_query_time = 1
min_examined_row_limit = 100
log_bin_trust_function_creators=1
binlog_cache_size = 1M
max_binlog_cache_size   = 16M
log-bin=mysql-bin
max_binlog_size         = 128M    #这个可以根据业务增加,但是感觉最大不要超过1G
#binlog-ignore-db = test
#binlog-ignore-db = performance_schema

###***MyISAM parameters***
key_buffer_size = 32M
myisam_sort_buffer_size = 16M
myisam_max_sort_file_size = 16M
myisam_repair_threads = 1

###***Innodb storage engine parameters***
innodb_page_size = 16384
innodb_buffer_pool_size = 8G        #这个根据内存来调整
innodb_buffer_pool_instances=1的整数倍(为内存的70?75%)
innodb_buffer_pool_load_at_startup = 1
innodb_buffer_pool_dump_at_shutdown = 1
innodb_lru_scan_depth = 4096
innodb_lock_wait_timeout = 2
innodb_io_capacity = 4000
innodb_io_capacity_max = 8000
innodb_file_format = Barracuda
innodb_file_format_max = Barracuda
innodb_flush_method=O_DIRECT
innodb_flush_neighbors = 0       ----?
innodb_purge_threads = 4
innodb_large_prefix = 1
innodb_thread_concurrency = 64     #见意采用默认值0
innodb_print_all_deadlocks = 1
innodb_strict_mode = 1
innodb_sort_buffer_size = 64M
innodb_write_io_threads = 16
innodb_read_io_threads = 16 
innodb_file_per_table=1
innodb_stats_persistent_sample_pages = 64
innodb_autoinc_lock_mode = 2

innodb_data_home_dir = /data/mysql/3306
innodb_data_file_path = ibdata1:100M:autoextend
innodb_max_dirty_pages_pct = 85     #默认为90,见意85

innodb_log_buffer_size = 64M
innodb_log_group_home_dir = /data/mysql/3306
innodb_log_file_size = 128M
innodb_log_files_in_group = 3
innodb_flush_log_at_trx_commit = 2

#innodb_undo_tablespaces = 3
#innodb_undo_directory
#innodb_undo_logs = 128

#innodb_file_io_threads = 4  #文件读写io数,这个参数只在Windows上起作用。在linux上只会等于4
#innodb_use_native_aio = 0  #使用linux的异步i/o,默认启用

###***master-slave replication parameters***
#enforce-gtid-consistency=true
#gtid-mode=on
binlog_gtid_simple_recovery = 1
master_info_repository="TABLE"
relay_log_info_repository="TABLE"
sync_binlog             = 1
binlog_format = row
binlog_rows_query_log_events = 1
relay_log_recovery=1
skip_slave_start
log_slave_updates=1
relay_log=mysql-relay-bin
#slave_skip_errors = ddl_exist_errors
#slave_rows_search_algorithms = 'INDEX_SCAN,HASH_SCAN'

# semi sync replication settings #
#plugin_load = "validate_password.so;rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so"
#rpl_semi_sync_master_enabled = 1
#rpl_semi_sync_master_timeout = 3000
#rpl_semi_sync_slave_enabled = 1

# password plugin #
#validate_password_policy=STRONG
#validate-password=FORCE_PLUS_PERMANENT

# new innodb setting in 5.7#
loose_innodb_numa_interleave=1
innodb_buffer_pool_dump_pct = 40
innodb_page_cleaners = 16
innodb_undo_log_truncate = 1
innodb_max_undo_log_size = 2G
innodb_purge_rseg_truncate_frequency = 128
# new replication setting #
#slave_parallel_type = LOGICAL_CLOCK
#slave_parallel_workers = 16
#slave_preserve_commit_order=1
#slave_transaction_retries=128
# other change setting #
#binlog_gtid_simple_recovery=1
#log_timestamps=system
#show_compatibility_56=on

[mysqld_safe]
open-files-limit = 8192

[client] 
default-character-set= utf8