在试Mysql5.6,搭了个主从:
CHANGE MASTER TO
MASTER_HOST='1.2.3.4',
master_user='slave',
master_password='xxxqqq',
master_port=,
MASTER_LOG_FILE='binlog.000001',
MASTER_LOG_POS=;
一切正常。然后在主上建个表,在从上一看没有。再看看状态:
mysql> show slave status\G;
*************************** . row ***************************
Slave_IO_State:
Master_Host: 1.2.3.4
Master_User: slave
Master_Port:
Connect_Retry:
Master_Log_File: binlog.
Read_Master_Log_Pos:
Relay_Log_File: relaylog.
Relay_Log_Pos:
Relay_Master_Log_File: binlog.
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno:
Last_Error:
Skip_Counter:
Exec_Master_Log_Pos:
Relay_Log_Space:
Until_Condition: None
Until_Log_File:
Until_Log_Pos:
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno:
Last_IO_Error: Got fatal error from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event 'binlog.' at 107, the last event read from '/mnt/disk1/mysql_5615_binlog/binlog.' at 107, the last byte read from '/mnt/disk1/mysql_5615_binlog/binlog.' at 126.'
Last_SQL_Errno:
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id:
Master_UUID: aa8bc3d4-81aa-11e3--001517a25b3a
Master_Info_File: /mnt/disk1/mysql_5615/master.info
SQL_Delay:
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
Master_Retry_Count:
Master_Bind:
Last_IO_Error_Timestamp: ::
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position:
row in set (0.00 sec) ERROR:
No query specified
确认了我的max_allowed_packet 是32M,太够了啊。搞了半天无果,后来搜了搜,发现了这个贴子(http://blog.chinaunix.net/uid-451-id-3087001.html),说是根本原因是偏移量不对。于是去主上看看:
mysqlbinlog binlog.
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at
# :: server id end_log_pos CRC32 0xf881fb00 Start: binlog v , server v 5.6.-debug-log created :: at startup
ROLLBACK/*!*/;
BINLOG '
KcPdUg9ZAgAAdAAAAHgAAAAAAAQANS42LjE1LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAApw91SEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAAQD7
gfg=
'/*!*/;
# at
# :: server id end_log_pos CRC32 0x4763204a Query thread_id= exec_time= error_code=
于是在从上重新change master to,把偏移量设成120,就一切正常了。
我之前搞Mysql5.5时一直是偏移量107的,到了现在5.6了变成了120,有趣。
另外也是头脑反应慢了些,其实在主上看状态时也应该能反应到的:
mysql> show binary logs;
+---------------+-----------+
| Log_name | File_size |
+---------------+-----------+
| binlog. | |
| binlog. | |
| binlog. | |
+---------------+-----------+
rows in set (0.03 sec)
 
 

mysql5.6设置主从报错1236,Increase max_allowed_packet on master,原因却是Binlog偏移量不对的更多相关文章

  1. MySQL主从报错1594

    一.主从报错 Relay log read failure 问题原因,MySQL主从使用的是kvm虚拟机,物理机超分严重,在负载高的情况下会kill掉占用资源最多的虚拟机,再启动后导致主从失败 mys ...

  2. mysql5.7同步复制报错1060故障处理

    mysql5.7同步复制报错故障处理 # 报错 1060,具体如下Last_Errno: 1060Last_Error: Coordinator stopped because there were ...

  3. ecstore在MySQL5.7下维护报错WARNING:512 @ ALTER IGNORE TABLE

    ecstore在MySQL5.7下维护报错WARNING:512 @ ALTER IGNORE TABLE 打开 /app/base/lib/application/dbtable.php , 替换A ...

  4. mysql5.6版本备份报错

    MySQL5.6版本备份报错,密码不安全 [root@centos199 mysql]# mysqldump -uroot -ppassword cz-office > mysql38.sqlW ...

  5. mysql主从报错截图

    1.首先确认报错的binlog和last event. 2.然后去主的机器上查看该报错的内容和报错的的位置,如果是结尾报错的,可以直接从新的binlog进行同步. #/mysql/logs# ../b ...

  6. Vue.js报错Failed to resolve filter问题原因

    Vue.js报错Failed to resolve filter问题原因 金刚 vue Vue.js js javascript 之前使用vue.js写分页功能时,写了一个过滤器,发现一个比较奇怪的错 ...

  7. 运维与开发的开车现场之MySQL5.7创建触发器报错解决过程

    报错内容如下: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds ...

  8. mysql5.7初始化密码报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before

    mysql初始化密码常见报错问题1,mysql5.6是密码为空直接进入数据库的,但是mysql5.7就需要初始密码 cat /var/log/mysqld.log | grep password1 2 ...

  9. mysql5.7初始化密码报错ERROR1820(HY000):YoumustresetyourpasswordusingALTERUSERstateme

    1,mysql5.6是密码为空直接进入数据库的,但是mysql5.7就需要初始密码 cat /var/log/mysqld.log | grep password 或者:grep 'temporary ...

随机推荐

  1. oracle varchar2 和varchar 区别

    今天,往ORACLE一个表的VACHAR2(20)字段中插入七个汉字,提示错误:插入的值太大. 改成插入六个汉字,又可以. 一直以来,都以为一个汉字占两个字节.觉得非常奇怪. 用length().le ...

  2. fiddler4使用教程(转)

    Fiddler的基本介绍 Fiddler的官方网站:  www.fiddler2.com Fiddler官方网站提供了大量的帮助文档和视频教程, 这是学习Fiddler的最好资料. Fiddler是最 ...

  3. Cocos2d-x3.0 Button

    Size widgetSize = Director::getInstance()->getWinSize(); Text* alert = Text::create("Layout& ...

  4. Coreseek:indexer crashed不解之谜

    前两天浩哥让我再把Coreseek的索引再做一次,由于需求那边有点变化,要把索引的公司名字显示出来,就在配置文件中面加入了sql_field_string:字符串字段.. 这个属性特别好用,由于它不仅 ...

  5. (017)将一棵二叉查找树重构成链表(keep it up)

    给定一棵二叉查找树,设计算法,将每一层的全部结点构建为一个 链表(也就是说, 假设树有D层,那么你将构建出D个链表). 这个题实质是个BFS,可是实现起来有点麻烦,又不像常见的BFS, 所以编写代码时 ...

  6. 007 字符串(keep it up)

    如果你有一个isSubstring函数.能够检測一个字符串是否是还有一个字符串的子串.  给出字符串s1和s2.仅仅使用一次isSubstring就能推断s2是否是s1的旋转字符串, 请写出代码.旋转 ...

  7. Android网络服务发现(NSD)协议的使用

    Android的网络服务发现协议(NSD)能够用于在小范围的网络中发现邻近设备上的某个应用.这对于一些社交网络.多人游戏类的应用会很有帮助. Android的NSD的用法大致上分为四种操作: 1. 注 ...

  8. bootstrap之DumpWindowHierarchy

    DumpWindowHierarchy package io.appium.android.bootstrap.handler; import android.os.Environment; impo ...

  9. SharePoint发展 - 使用Session(代码更改webconfig)

    博客地址 http://blog.csdn.net/foxdave SharePoint启用Session能够使用Powershell,戳这里:能够改动webconfig. 本篇叙述的重点是通过fea ...

  10. 使用dom4j创建和解析xml

    之前工作中用到了,相信写java的都会碰到xml,这里写了两个方法,创建和解析xml,废话不多说,直接上代码 package xml; import java.io.File; import java ...