MySQL Error 1236 错误解决办法
发布:smiling 来源: PHP粉丝网 添加日期:2014-10-17 10:50:47 浏览: 评论:0
在一次不小心电脑突然掉电了,开机开就出来了080922 10:29:01 [Note] Slave SQL thread initialized, starting replication in log mysql-bin.000778 at position 2874108, relay log \' ./relay-bin.003287\' position: 2874245
今天几台MySQL服务器突然停电,重启后复制无法启动,总是报如下错误:
- 080922 10:29:01 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000778' at position 2874108, relay log ' ./relay-bin.003287' position: 2874245
- 080922 10:29:01 [Note] Slave I/O thread: connected to master 'replication@192.168.0.10:3306', replication started in log 'mysql-b in.000778' at position 2874108
- 080922 10:29:01 [ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( se rver_errno=1236) --phpfensi.com
- 080922 10:29:01 [ERROR] Got fatal error 1236: 'Client requested master to start replication from impossible position' from master wh en reading data from binary log
为什么会报impossible position呢?打开mysql-bin.000778看看.
- mysqlbinlog mysql-bin.000778 > log.sql
- tail -f log.sql
- # at 2871574 #080922 10:20:27 server id 2 end_log_pos 2871601 Xid = 2516638
- COMMIT/*!*/;
- DELIMITER ;
- # End of log file
- ROLLBACK /* added by mysqlbinlog */;
- /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/
最后一个position是2871574,而从库要从2874108开始,难怪报impossible position,难道是断电时有部分log在缓存中还没来得及写入binglog?无论如何先恢复再说吧.
- stop slave;
- CHANGE MASTER TO
- MASTER_LOG_FILE='mysql-bin.000778',
- MASTER_LOG_POS=2871574;
- start slave;
- show slave statusG
同步正常,后来查看主库的启动日志中这样一段:
- InnoDB: Last MySQL binlog file position 0 2874108, file name ./mysql-bin.000778
- 080922 10:22:09 InnoDB: Started; log sequence number 6 2534366248
- 080922 10:22:09 [Note] Recovering after a crash using mysql-bin
- 080922 10:22:09 [Note] Starting crash recovery...
- 080922 10:22:09 [Note] Crash recovery finished.
- 080922 10:22:09 [Note] /usr/sbin/mysqld: ready for connections.
这里Last MySQL binlog file position 0 2874108也是错误的,这个信息到底是哪里来的呢?为什么会这样呢?不明白,为了保证以后binglog及时写入,将主库sync_binlog变量设置1.
Tags: MySQL1236 Error1236
相关文章
- ·怎样使MySQL安全以对抗解密高手(2013-11-11)
- ·MYSQL用户root密码为弱口令的攻击(2013-11-11)
- ·数据库系统防黑客入侵技术综述(2013-11-11)
- ·Mysql数据库的安全配置、实用技巧(2013-11-11)
- ·Mssql和Mysql的安全性分析(2013-11-11)
- ·MySQL安全问题的一点心得(2013-11-11)
- ·PHP常用MySql操作(2013-11-13)
- ·Oracle8的不安全因素及几点说明(2013-11-14)
- ·MySQL数据库下载漏洞攻击技术(2013-11-14)
- ·MySQL3.23.31之前版本的安全漏洞(2013-11-14)
- ·通过Mysql的语句生成后门木马的方法(2013-11-14)
- ·MySQL服务器内部安全数据目录访问(2013-11-14)
- ·MySQL数据库中的安全解决方案(2013-11-14)
- ·如何保护MySQL 中的重要数据(2013-11-14)
- ·为你的MySQL数据库加铸23道安全门(2013-11-14)
- ·Mysql的Root密码遗忘的解决办法(2013-11-14)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)