MYSQL主从复制搭建全过程实战---探索不能实时同步的关键性参数(二)

2015-07-24 12:13:17 · 作者: · 浏览: 92
1 row in set (0.00 sec)


3、备库上没有同步过去,但我在备库操作flush logs;命令就能同步过来!




4、查主库上的几个参数:
mysql> show variables like '%autocommit%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| autocommit | ON |
+---------------+-------+
1 row in set (0.00 sec)

mysql> show variables like '%innodb_flush_metho%';
+---------------------+----------+
| Variable_name | Value |
+---------------------+----------+
| innodb_flush_method | O_DIRECT |
+---------------------+----------+
1 row in set (0.00 sec)


mysql> show variables like '%sync_binlog%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sync_binlog | 100 |
+---------------+-------+
1 row in set (0.00 sec)




5、找到原因:sync_binlog=100,在主库把参数:sync_binlog设为1即可!!!
set global sync_binlog=1; ---最好永久设置改my.cnf配置文件



6、记下常用几个命令
reset master;
show master status\G;
show binlog events in 'binlog.000001';
flush logs;

?