mysql配置

目录

socket

socket  = /data/mysql/3306/mysql.sock #sockt文件存放位置

basedir

basedir = /usr/local/webserver/mysql

datadir

datadir = /data/mysql/3306/data

relay-log

relay-log-index = /data/mysql/3306/relaylog/relaylog
relay-log-info-file = /data/mysql/3306/relaylog/relaylog
relay-log = /data/mysql/3306/relaylog/relaylog

log-bin

log-bin = /data/mysql/3306/binlog/binlog #配置binlog的存放位置

log-slave-updates

log-slave-updates = 1  #让relaylog 写入binlog 做双主时必须加上这个配置

sync\_binlog

sync_binlog = 1 #默认情况下,并不是每次写入时都将binlog与硬盘同步,要想防止这种情况,你可以使用sync_binlog全局变量

expire\_logs\_days

expire_logs_days = 7 #设置mysql的binlog保留7天的,这个在做主从时要注意检查从库是否再同步,如果同步停止,超过7天就只有重做了

目录