Home >Database >Mysql Tutorial >mysql主从复制 数据延时有关问题

mysql主从复制 数据延时有关问题

WBOY
WBOYOriginal
2016-06-07 16:15:381101browse

mysql主从复制 数据延时问题 主从都是从用innodb引擎,发生延时问题严重,把从库引擎修改为myisam引擎,暂时效果还不错。 为彻底解决该问题,参考淘宝丁奇的一些策略,打算采用Transfer方式,还在分析之中: 1. show variables like 'binlog_format';? 查看日

mysql主从复制 数据延时问题

主从都是从用innodb引擎,发生延时问题严重,把从库引擎修改为myisam引擎,暂时效果还不错。

为彻底解决该问题,参考淘宝丁奇的一些策略,打算采用Transfer方式,还在分析之中:

1. show variables like 'binlog_format';? 查看日志格式 mysql5.6?默认 statement,需要修改主库为row模式

这是从网上搜寻的动态修改方式,也可在配置文件中修改

mysql<span>></span> <span>SET</span> <span>SESSION</span> binlog_format <span>=</span> <span>'STATEMENT'</span>;
mysql<span>></span> <span>SET</span> <span>SESSION</span> binlog_format <span>=</span> <span>'ROW'</span>;
mysql<span>></span> <span>SET</span> <span>SESSION</span> binlog_format <span>=</span> <span>'MIXED'</span>;
mysql<span>></span> <span>SET</span> GLOBAL binlog_format <span>=</span> <span>'STATEMENT'</span>;
mysql<span>></span> <span>SET</span> GLOBAL binlog_format <span>=</span> <span>'ROW'</span>;
mysql<span>></span> <span>SET</span> GLOBAL binlog_format <span>=</span> <span>'MIXED'</span>;

?

2.

?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn