主
[mysqld]
#lower_case_table_names=1
character-set-server=utf8
collation-server=utf8_general_ci
expire_logs_days = 7
#双机热备配置相关
server-id=10
log-bin=mysql-bin
auto-increment-increment=2 #每次增长2
auto-increment-offset=1 #设置自动增长的字段的偏移量,即初始值为1
从
[mysqld]
server-id=19
log-bin=mysql-bin
auto-increment-increment=2 #每次增长2
auto-increment-offset=2 #设置自动增长的字段的偏移量,即初始值为2
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
character-set-server=utf8
collation-server=utf8_general_ci