[mysql-cli]
default-character-set=utf8
[mysqld]
#基本优化
user = mysql
skip-name-resolve = ON
port = 3306
bind-address = 0.0.0.0
server_id=1
innodb_file_per_table=ON
#log_bin=/home/mnt/data/bin-log
#relay_log=/home/mnt/data/relay-log
socket=/var/lib/mysql/mysql.sock
datadir=/home/mnt/data
character-set-server=utf8
lower_case_table_name=1
max_allowed_packet=1024M
#生产优化
#innodb
innodb_buffer_pool_size=6G
innodb_log_file_size=4G
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit=2
#innodb_file_per_table=1
innodb_file_io_threads=4
innodb_flush_method=O_DIRECT
innodb_io_capacity=2000
innodb_io_capacity_max=6000
innodb_lru_scan_depth=2000
innodb_thread_concurrency = 0
innodb_additional_mem_pool_size=16M
innodb_autoinc_lock_mode = 2
wait_timeout=31536000
interactive_timeout=31536000
##Binary log/replication
#log-bin = /home/mnt/data/bin-log
#sync_binlog=1
#sync_relay_log=1
#relay-log-info-repository=TABLE
#master-info-repository=TABLE
#expire_logs_days=7
#binlog_format=ROW
#gtid_mode = on
#enforce_gtid_consistency = 1
#log_slave_updates
#transaction-isolation=READ-COMMITTED
#log_error = error.log
#slow_query_log = 1
#slow_query_log_file = 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
#
#cache
default-storage-engine=innodb
tmp_table_size=512M
character-set-server=utf8
collation-server=utf8_general_ci
skip-external-locking
back_log=1024
key_buffer_size=1024M
thread_stack=256k
read_buffer_size=8M
thread_cache_size=64
query_cache_size=128M
max_heap_table_size=256M
query_cache_type=1
binlog_cache_size = 2M
table_open_cache=128
thread_cache=1024
thread_concurrency=8
join_buffer_size = 1024M
sort_buffer_size = 8M
read_rnd_buffer_size = 8M
#connect
max-connect-errors=10000
max-connections=1000
网友评论