socket = /usr/local/mysql/data/mysql.sock
skip_external_locking = 1
default_storage_engine = InnoDB
character-set-server = utf8
pid_file = /usr/local/mysql/data/mysqld.pid
basedir = /usr/local/mysql
explicit_defaults_for_timestamp = off
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
innodb_undo_directory = /usr/local/mysql/undo
innodb_undo_tablespaces = 8
max_allowed_packet = 100M
# 最大连接错误,超出该值以后,服务器将阻止该客户端后续的所有访问
max_connect_errors = 1000000
secure-file-priv = '/tmp'
default_authentication_plugin='mysql_native_password'
relay_log = mysqld-relay-bin
master_info_repository = TABLE
relay_log_info_repository = TABLE
datadir = /usr/local/mysql/data/
log_bin = /usr/local/mysql/sql_log/mysql-bin
# 如果二进制日志写入的内容超出给定值,日志就会发生滚动
binlog_expire_logs_seconds=86400
max_heap_table_size = 32M
table_definition_cache = 4096
# 排序语句 'group by' 与 'order by' 占用的大小
read_rnd_buffer_size = 2M
max_length_for_sort_data = 16k
# 使用O_DIRECT模式打开数据文件,用fsync()函数去更新日志和数据文件。
innodb_flush_method = O_DIRECT
innodb_log_buffer_size = 16M
innodb_flush_log_at_trx_commit = 2
#作用:使每个Innodb的表,有自已独立的表空间。如删除文件后可以回收那部分空间。
#分配原则:只有使用不使用。但DB还需要有一个公共的表空间。
innodb_file_per_table = 1
innodb_buffer_pool_size = 256M
innodb_stats_on_metadata = off
innodb_read_io_threads = 16
innodb_write_io_threads = 16
# 这个参数据控制Innodb checkpoint时的IO能力
innodb_io_capacity = 20000
innodb_thread_concurrency = 0
# 在回滚(rooled back)之前,InnoDB 事务将等待超时的时间(单位 秒)
innodb_lock_wait_timeout = 60
innodb_old_blocks_time = 1000
innodb_use_native_aio = 1
# 当随后页面被读到内存中时,会将这些变化的记录merge到页中。
innodb_change_buffering = all
# 可以减少刷新缓冲池的次数,从而减少磁盘 I/O。
innodb_log_file_size = 64M
innodb_log_files_in_group = 2
innodb_data_file_path = ibdata1:256M:autoextend
innodb_rollback_on_timeout = on
log_error = /usr/local/mysql/sql_log/mysql-error.log
slow_query_log_file = /usr/local/mysql/sql_log/slowlog.log