#基本配置
port=3306
Pid-file=/mnt/mysql/data/mysql.pid
Socket=/tmp/mysql.sock
Datadir=/data/mysql/data
Character_set_server=utf8
Default_storage_engine=innodb
#日志相关的配置
Log_error=/mnt/mysql/data/err.log
Slow_query_log=on
Slow_query_log_file=/mnt/mysql/data/slow.log
Long_query_time=1
Bin_log=mysql-bin
Binlog_format=statement
expire_logs_days=7#设置二进制日志保留的时间
#主从场景从库相关配置
Log_slave_updates#在从库开启二进制日志
Relay-log=relay-bin
Skip_slave_start#重启mysql后, replication does not start automatically
Relay-log-purge#重放完中继日志后将此中继日志删除
Read_Only#设置从库为只读, in addition to root and SQL replication threads
#优化相关的配置
max_allow_packet=1g
Innodb_file_per_table=1
This article is from the "burning Years of Passion" blog, please be sure to keep this source http://liuzhengwei521.blog.51cto.com/4855442/1881278
MYSQL-MARIADB the configuration used in practice (continuous improvement)