从库出现问题

mysql>show slave status\G;*************************** 1. row ***************************Slave_IO_State:

Master_Host:192.168.220.141Master_User: rep

Master_Port:3306Connect_Retry:60Master_Log_File: mysql-bin.000005 I/O线程当前正在读取的主服务器二进制日志文件的名称Read_Master_Log_Pos:764 在当前的主服务器二进制日志中,I/O线程已经读取的位置Relay_Log_File: relay-bin.000018 SQL线程当前正在读取和执行的中继日志文件的名称Relay_Log_Pos:4 在当前的中继日志中,SQL线程已读取和执行的位置Relay_Master_Log_File: mysql-bin.000005 由SQL线程执行的包含多数近期事件的主服务器二进制日志文件的名称Slave_IO_Running: No

Slave_SQL_Running: Yes

Replicate_Do_DB:

Replicate_Ignore_DB: mysql

Replicate_Do_Table:

Replicate_Ignore_Table:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Last_Errno:0 最后的错误号,0表示没有错误Last_Error:                   最后错误的描述

Skip_Counter:0 最近被使用的用于SQL_SLAVE_SKIP_COUNTER的值Exec_Master_Log_Pos:764 来自主服务器的二进制日志的由SQL线程执行的上一个时间的位置(Relay_Master_Log_File)。在主服务器的二进制日志中的(Relay_Master_Log_File,Exec_Master_Log_Pos)对应于在中继日志中的(Relay_Log_File,Relay_Log_Pos)Relay_Log_Space:107              所有原有的中继日志结合起来的总大小Until_Condition: None

Until_Log_File:

Until_Log_Pos:0Master_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:1236

Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: ‘Could not find first log file name in binary log index file‘Last_SQL_Errno:0Last_SQL_Error:

Replicate_Ignore_Server_Ids:

Master_Server_Id:1

1 row in set (0.00sec)

ERROR:

No query specified

mysql>

查看mysql的错误日志

大致的意思就是说,从库不能读取主库的binlog日志文件了,造成这种故障的原因可能是:

从库不能连接主库

主库的binlog日志被删除了

.......

[[email protected] ~]# tail /data/3307/mysql.err //查看错误日志151129 23:14:41 [Note] Slave SQL thread initialized, starting replication in log ‘mysql-bin.000005‘ at position 764, relay log ‘/data/3307/relay-bin.000018‘ position: 4

151129 23:14:41 [ERROR] Error reading packet from server: Could not find first log file name in binary log index file ( server_errno=1236)151129 23:14:41 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: ‘Could not find first log file name in binary log index file‘, Error_code: 1236

151129 23:14:41 [Note] Slave I/O thread exiting, read up to log ‘mysql-bin.000005‘, position 7643307]# ping 192.168.220.141 //测试和主库的连通性PING192.168.220.141 (192.168.220.141) 56(84) bytes of data.64 bytes from 192.168.220.141: icmp_seq=1 ttl=64 time=0.197ms64 bytes from 192.168.220.141: icmp_seq=2 ttl=64 time=0.029ms64 bytes from 192.168.220.141: icmp_seq=3 ttl=64 time=0.025ms^C--- 192.168.220.141 ping statistics ---

查看主库的日志

Slave I/O thread exiting, read up to log ‘mysql-bin.000005‘, position 764提示读取mysql-bin.000005错误,查看主库的binlog日志后发现没有mysql-bin.0000005日志文件

这是因为长时间没有开启数据库,binlog的存活时间是7天,所以binlog00000005日志应该是被删除了

规定binlog日志存活时间的参数在my.cnf中

expire_logs_days = 7 //单位是天,0表示不自动删除

[[email protected] ~]# ll /data/3306/total36drwxr-xr-x 5 mysql mysql 4096 Nov 29 23:08data-rw-r--r-- 1 mysql mysql 1899 Oct 16 00:46my.cnf-rwx------ 1 root root 1307 Oct 16 01:44mysql-rw-rw---- 1 mysql mysql 107 Nov 29 23:08 mysql-bin.000006

-rw-rw---- 1 mysql mysql 28 Nov 29 23:08 mysql-bin.index

srwxrwxrwx1 mysql mysql 0 Nov 29 23:08mysql.sock-rw-r----- 1 mysql root 10993 Nov 29 23:08mysql_oldboy3306.err-rw-rw---- 1 mysql mysql 5 Nov 29 23:08

调整从库的同步位置:

change master to master_log_file=‘mysql-bin.000006‘,master_log_pos=4

mysql>stop slave;

Query OK,0 rows affected (0.00sec)

mysql> change master to master_log_file=‘mysql-bin.000006‘,master_log_pos=4;

Query OK,0 rows affected (0.32sec)

mysql>start slave;

Query OK,0 rows affected (0.00sec)

mysql>show slave status\G;*************************** 1. row ***************************Slave_IO_State: Waitingformaster to send event

Master_Host:192.168.220.141Master_User: rep

Master_Port:3306Connect_Retry:60Master_Log_File: mysql-bin.000006Read_Master_Log_Pos:107Relay_Log_File: relay-bin.000002Relay_Log_Pos:253Relay_Master_Log_File: mysql-bin.000006Slave_IO_Running: Yes

Slave_SQL_Running: Yes

Replicate_Do_DB:

Replicate_Ignore_DB: mysql

Replicate_Do_Table:

Replicate_Ignore_Table:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Last_Errno:0Last_Error:

Skip_Counter:0Exec_Master_Log_Pos:107Relay_Log_Space:403Until_Condition: None

Until_Log_File:

Until_Log_Pos:0Master_SSL_Allowed: No

Master_SSL_CA_File:

Master_SSL_CA_Path:

Master_SSL_Cert:

Master_SSL_Cipher:

Master_SSL_Key:

Seconds_Behind_Master:0Master_SSL_Verify_Server_Cert: No

Last_IO_Errno:0 //没有IO错误了Last_IO_Error:

Last_SQL_Errno:0Last_SQL_Error:

Replicate_Ignore_Server_Ids:

Master_Server_Id:1

1 row in set (0.00sec)

ERROR:

No query specified

mysql>

原文:http://www.cnblogs.com/along1226/p/5006022.html

1236mysql,MySQL1236错误的恢复相关推荐

  1. 纳米孔测序高错误区域恢复率高达99%,肖传乐/刘奕志/王建新等在Nature子刊发表新校正组装算法

    纳米孔测序高错误区域恢复率高达99%,肖传乐/刘奕志/王建新等在Nature子刊发表新校正组装算法 2021-01-07 15:54 新基因组组装是基因组学最重要的任务之一.三代测序技术(PacBio ...

  2. Openstack虚机实例状态错误手工恢复vm_state:error

    Openstack虚机实例状态错误手工恢复vm_state:error Openstack虚机实例状态错误手工恢复vm_state:error 1.找到状态为出错状态的VM.在数据库里面表现Statu ...

  3. 【Antlr】 Antlr 错误与恢复

    1.概述 参考:Antlr4 第九章 错误与恢复 g4文件 grammar Simple;prog: classDef+ ; // match one or more class definition ...

  4. MSSQL 2000 错误823恢复数据案例

    一.故障描述 MSSQL Server 2000 附加数据库错误823,附加数据库失败.数据库没有备份,不能通过备份恢复数据库,急需恢复数据库中的数据. 二.故障分析 SQL Server数据库 82 ...

  5. 数据恢复错误卡住 linux,如何处理ORA-00376错误的恢复问题

    在检查系统的时发现系统报出关于ORA-00376 错误信息,总体说数据文件 :/database/data1/orcldata/d_datafile7.dbf  有错? 那遇到这种问题如何解决呢, 下 ...

  6. 1603错误_iPhone恢复iTunes未知错误怎么办【解决方法】

    iTunes和iPhone设备更新和恢复固件出现未知错误信息及故障解决办法! itunes发生未知错误,itunes未知错误 未知错误2 此问题通常可以通过停用或者卸载第三方安全软件来解决 未知错误6 ...

  7. solaris系统crle错误设置恢复

    今天本来是放假的,结果上海现场出了问题,还得来加班解决. 问题描述: 使用了错误的配置命令crle,造成系统无法登录,也无法执行su(丢失了/lib和/usr/lib)等很多系统命令 crle -c ...

  8. html转chm后脚本错误,win10系统打开chm资料弹出窗口提示脚本出现错误的恢复办法...

    有关win10系统打开chm资料弹出窗口提示脚本出现错误的操作方法想必大家有所耳闻.但是能够对win10系统打开chm资料弹出窗口提示脚本出现错误进行实际操作的人却不多.其实解决win10系统打开ch ...

  9. python错误找回_python字典键错误无法恢复

    我正在一个巨大的链接列表中执行状态检查,我的代码片段如下:link = 'http://xyz' proxyDict = { "http" : "ip:80", ...

  10. 搜苹果ipad版_苹果iPhone/iPad升级错误进入恢复模式,代码14,应该如何处理?

    为了给妹妹下载画画软件,发现ipad版本太低,没法儿安装,头脑一热就连接了Mac用itunes进行了升级.并且,灾难的是,升级之前电脑提示我备份时,我根本没有在意,直接点了不需要备份.更灾难的是,我之 ...

最新文章

  1. 产销对接行动倡议书-万祥军:长效机制谋定丰收节交易会
  2. c++和python的区别、javascript_python和c++的区别
  3. Java并发编程之FutureTask源码解析
  4. Java并发——线程安全
  5. 导出excel数字前面的0消失_Excel操作中常见的3大坑你遇到过吗?遇到应该这么解决...
  6. Combobox绑定数据源DataSet
  7. windows下php不支持mysql
  8. pairwork2测试作业
  9. Eclipse自动生成作者、日期注释等功能设置
  10. VNC Connect Enterprise for mac(远程桌面软件)
  11. Java实现棒子老虎鸡小游戏
  12. wordpress限制最大上传文件为3M
  13. Linux教程-修炼
  14. Eclipse下SVN工具使用
  15. 教程—— 微信公众号如何接入客服系统
  16. oracle php 教程 pdf,AJAX+PHP+Oracle数据库Web开发 ((美)Lee Barney) 中文PDF扫描版 37.5M
  17. ValueError: A 0.7-series setuptools cannot be installed with distribute.
  18. QT——Qt QtCreator 官方下载地址
  19. docker 命令详解(二十四):push
  20. Nginx同一个域名配置多个项目

热门文章

  1. 2.使用RNN做诗歌生成
  2. u3d occlusion 遮挡剔除
  3. VS2013 设置背景图
  4. 显示器选购参数解析-为了给笔记本买个外接显示器,我的笔记本核显支持4K60Hz吗
  5. 3D游戏编程与设计作业五
  6. 三原色亮度最高_行业最亮88000流明三色激光投影机,为何出自中科极光“之手”?...
  7. Domain Adaptation论文合集
  8. Fireball真相:一个菜鸟级流氓软件竟让老外如临大敌
  9. 关于医学影像中的轴位面(横断面)、冠状面、矢状面
  10. 微信小程序加入购物车效果动画