<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[阿Tim日志]]></title> 
<link>https://atim.cn/index.php</link> 
<description><![CDATA[专业的php开发者.开发团队的带队人]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[阿Tim日志]]></copyright>
<item>
<link>https://atim.cn/post//</link>
<title><![CDATA[mysql 同步失败解决方法 (错误:1236)]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[有感而发]]></category>
<pubDate>Fri, 08 Apr 2011 08:00:28 +0000</pubDate> 
<guid>https://atim.cn/post//</guid> 
<description>
<![CDATA[ 
	在重启了外国B的服务器后,发现国内A数据库同步突然停止了，导致国内A服务器复制失败，如下：<br/><br/>国内A就报下面的错误：<br/><div class="code"><br/>090910 22:47:18 &#91;ERROR&#93; Error reading packet from server: Client requested master to start replication from impossible position ( server_errno=1236)<br/>090910 22:47:18 &#91;ERROR&#93; Got fatal error 1236: Client requested master to start replication from impossible position from master when reading data from binary log<br/>090910 22:47:18 &#91;Note&#93; Slave I/O thread exiting, read up to log mysql-bin.000008, position 753871857<br/></div><br/>国外B是正常的。<br/>然后我上网找一些一些资料.<br/>出现这样的错误是由于同步数据的位出现错误.也就是错误提示里说明的问题.<br/><br/>登陆到国外B上面用mysqlbinlog查看<br/><div class="code"><br/>&#91;root@xxx mysql&#93;# mysqlbinlog –start-position=753871857 mysql-bin.000008<br/>/*!40019 SET @@session.max_insert_delayed_threads=0*/;<br/>/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;<br/>DELIMITER /*!*/;<br/>DELIMITER ;<br/># End of log file<br/>ROLLBACK /* added by mysqlbinlog */;<br/>/*!50003 SET COMPLETION_TYPE=OLD_COMPLETION_TYPE*/;<br/></div><br/>确实没有这个位置,<br/>为了进一步确认，我将binlog dump成文本文件<br/><div class="code"><br/>mysqlbinlog mysql-bin.000008 &gt; 1.txt<br/></div><br/>开打1.txt文件<br/><div class="code"><br/># at 753870260<br/>#080724 16:21:25 server id 2 end_log_pos 753870665 Query thread_id=185 exec_time=0 error_code=0<br/>SET TIMESTAMP=1216887685/*!*/;<br/>insert into im_offlinemsg_200807(gmt_create,type,from_id,to_id,content)values(sysdate(),0,cnalichnzizufhm,cnalichnluelee,AAFcQzB4NzBmZlxGy87M5VxUob7Iureiob9cQzBcUzB4OS4weGI0XEbLzszlXFRodHRwOi8vYmJzLmticmVuLmNuL3RhaXdhbi5odG1sDQq7qMHLztLV+9X70rvN7cnPtcTKsbzksKGjrNbV09q447rDwcujrL/syKW/tL+0o6y8×7XDwfS49tHUxbZcVC86JFxULzpnaXJs)/*!*/;<br/><br/># at 753870665<br/>#080724 16:21:25 server id 2 end_log_pos 753870692 Xid = 35714167<br/>COMMIT/*!*/;<br/>DELIMITER ;<br/># End of log file<br/>ROLLBACK /* added by mysqlbinlog */;<br/>/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;<br/></div><br/><strong>找到他相接近的位置就可以了.</strong><br/>发现mysql-bin.000008里面最接近753871857的一个有效的position是753870665。好像有error_code是无效的。<br/><br/>然后在国外B上执行 再change master命令命令内容如下，将位置指定为这个最后位置：<br/><div class="code"><br/>stop slave;<br/>CHANGE MASTER TO MASTER_HOST=&#039;xxx.xxx.xxx.xxx&#039;,<br/>&nbsp;&nbsp;MASTER_USER=&#039;root&#039;,<br/>&nbsp;&nbsp;MASTER_PASSWORD=&#039;******&#039;,<br/>&nbsp;&nbsp;MASTER_LOG_FILE=&#039;mysql-bin.000008&#039;,<br/>&nbsp;&nbsp;MASTER_LOG_POS=753870665;<br/>start slave;<br/></div><br/>问题就解决了。<br/>
]]>
</description>
</item><item>
<link>https://atim.cn/post//#blogcomment</link>
<title><![CDATA[[评论] mysql 同步失败解决方法 (错误:1236)]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://atim.cn/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>