加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

Mysql应用mysql从库Last

发布时间:2020-12-12 00:48:30 所属栏目:MySql教程 来源:网络整理
导读:《Mysql应用mysql从库Last》要点: 本文介绍了Mysql应用mysql从库Last,希望对您有用。如果有疑问,可以联系我们。 导读:mysql从库Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file na

《Mysql应用mysql从库Last》要点:
本文介绍了Mysql应用mysql从库Last,希望对您有用。如果有疑问,可以联系我们。

导读:mysql从库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'报错处理 查看mysql运行状况与备份情况,登录mysql从库查看主从同步状态

  1. mysql>?show?slave?statusG;?
  2. ***************************?1.?row?***************************?
  3. ???????????????Slave_IO_State:??
  4. ??????????????????Master_Host:?101.200.*.*?
  5. ??????????????????Master_User:?backup?
  6. ??????????????????Master_Port:?3306?
  7. ????????????????Connect_Retry:?60?
  8. ??????????????Master_Log_File:?master-bin.000113?
  9. ??????????Read_Master_Log_Pos:?276925387?
  10. ???????????????Relay_Log_File:?mysql-relay.000001?
  11. ????????????????Relay_Log_Pos:?4?
  12. ????????Relay_Master_Log_File:?master-bin.000113?
  13. ?????????????Slave_IO_Running:?No?
  14. ????????????Slave_SQL_Running:?Yes?
  15. ??????????????Replicate_Do_DB:??
  16. ??????????Replicate_Ignore_DB:??
  17. ???????????Replicate_Do_Table:??
  18. ???????Replicate_Ignore_Table:??
  19. ??????Replicate_Wild_Do_Table:??
  20. ??Replicate_Wild_Ignore_Table:??
  21. ???????????????????Last_Errno:?0?
  22. ???????????????????Last_Error:??
  23. ?????????????????Skip_Counter:?0?
  24. ??????????Exec_Master_Log_Pos:?276925387?
  25. ??????????????Relay_Log_Space:?120?
  26. ??????????????Until_Condition:?None?
  27. ???????????????Until_Log_File:??
  28. ????????????????Until_Log_Pos:?0?
  29. ???????????Master_SSL_Allowed:?No?
  30. ???????????Master_SSL_CA_File:??
  31. ???????????Master_SSL_CA_Path:??
  32. ??????????????Master_SSL_Cert:??
  33. ????????????Master_SSL_Cipher:??
  34. ???????????????Master_SSL_Key:??
  35. ????????Seconds_Behind_Master:?NULL?
  36. Master_SSL_Verify_Server_Cert:?No?
  37. ????????????????Last_IO_Errno:?1236?
  38. ????????????????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'?
  39. ???????????????Last_SQL_Errno:?0?
  40. ???????????????Last_SQL_Error:??
  41. ??Replicate_Ignore_Server_Ids:??
  42. ?????????????Master_Server_Id:?21?
  43. ??????????????????Master_UUID:?e4a43da7-5b58-11e5-a12f-00163e003632?
  44. ?????????????Master_Info_File:?/home/data/mysql/master.info?
  45. ????????????????????SQL_Delay:?0?
  46. ??????????SQL_Remaining_Delay:?NULL?
  47. ??????Slave_SQL_Running_State:?Slave?has?read?all?relay?log;?waiting?for?the?slave?I/O?thread?to?update?it?
  48. ???????????Master_Retry_Count:?86400?
  49. ??????????????????Master_Bind:??
  50. ??????Last_IO_Error_Timestamp:?170204?10:48:06?
  51. ?????Last_SQL_Error_Timestamp:??
  52. ???????????????Master_SSL_Crl:??
  53. ???????????Master_SSL_Crlpath:??
  54. ???????????Retrieved_Gtid_Set:??
  55. ????????????Executed_Gtid_Set:??
  56. ????????????????Auto_Position:?0?
  57. 1?row?in?set?(0.00?sec)?
  58. ?
  59. ERROR:??
  60. No?query?specified?
突然之间Slave_IO_Running: 状态变成NO了

?MYSQL应用

解决方法.MYSQL应用

首先在从库上执行MYSQL应用

stop slave;MYSQL应用

查看主库master状态

?MYSQL应用

  1. mysql>?show?master?statusG;?
  2. ***************************?1.?row?***************************?
  3. ?????????????File:?mysql-bin.000113?
  4. ?????????Position:?276925387?
  5. ?????Binlog_Do_DB:??
  6. ?Binlog_Ignore_DB:??
  7. Executed_Gtid_Set:??
  8. 1?row?in?set?(0.00?sec)?
  9. ?
  10. ERROR:??
  11. No?query?specified?
  12. ?
  13. mysql>?flush?logs;?
  14. Query?OK,?0?rows?affected?(0.11?sec)?

刷新binlog日志MYSQL应用

flush logs;MYSQL应用

刷新后的日志会+1MYSQL应用

例如上面的?File: mysql-bin.000113 会变成?File: mysql-bin.000114MYSQL应用

再次查看master状态MYSQL应用

  1. mysql>?show?master?statusG;?
  2. ***************************?1.?row?***************************?
  3. ?????????????File:?mysql-bin.000114?
  4. ?????????Position:?120?
  5. ?????Binlog_Do_DB:??
  6. ?Binlog_Ignore_DB:??
  7. Executed_Gtid_Set:??
  8. 1?row?in?set?(0.00?sec)?
  9. ?
  10. ERROR:??
  11. No?query?specified?

然后就不需要在操作master,切换到从库MYSQL应用

输入CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000114',MASTER_LOG_POS=120;MYSQL应用

执行start slave;MYSQL应用

查看从库状态
?MYSQL应用

  1. mysql>?show?slave?statusG;?
  2. ***************************?1.?row?***************************?
  3. ???????????????Slave_IO_State:?Waiting?for?master?to?send?event?
  4. ??????????????????Master_Host:?101.200.*.*?
  5. ??????????????????Master_User:?backup?
  6. ??????????????????Master_Port:?3306?
  7. ????????????????Connect_Retry:?60?
  8. ??????????????Master_Log_File:?mysql-bin.000114?
  9. ??????????Read_Master_Log_Pos:?11314?
  10. ???????????????Relay_Log_File:?mysql-relay.000002?
  11. ????????????????Relay_Log_Pos:?11477?
  12. ????????Relay_Master_Log_File:?mysql-bin.000114?
  13. ?????????????Slave_IO_Running:?Yes?
  14. ????????????Slave_SQL_Running:?Yes?
  15. ??????????????Replicate_Do_DB:??
  16. ??????????Replicate_Ignore_DB:??
  17. ???????????Replicate_Do_Table:??
  18. ???????Replicate_Ignore_Table:??
  19. ??????Replicate_Wild_Do_Table:??
  20. ??Replicate_Wild_Ignore_Table:??
  21. ???????????????????Last_Errno:?0?
  22. ???????????????????Last_Error:??
  23. ?????????????????Skip_Counter:?0?
  24. ??????????Exec_Master_Log_Pos:?11314?
  25. ??????????????Relay_Log_Space:?11646?
  26. ??????????????Until_Condition:?None?
  27. ???????????????Until_Log_File:??
  28. ????????????????Until_Log_Pos:?0?
  29. ???????????Master_SSL_Allowed:?No?
  30. ???????????Master_SSL_CA_File:??
  31. ???????????Master_SSL_CA_Path:??
  32. ??????????????Master_SSL_Cert:??
  33. ????????????Master_SSL_Cipher:??
  34. ???????????????Master_SSL_Key:??
  35. ????????Seconds_Behind_Master:?0?
  36. Master_SSL_Verify_Server_Cert:?No?
  37. ????????????????Last_IO_Errno:?0?
  38. ????????????????Last_IO_Error:??
  39. ???????????????Last_SQL_Errno:?0?
  40. ???????????????Last_SQL_Error:??
  41. ??Replicate_Ignore_Server_Ids:??
  42. ?????????????Master_Server_Id:?21?
  43. ??????????????????Master_UUID:?e4a43da7-5b58-11e5-a12f-00163e003632?
  44. ?????????????Master_Info_File:?/home/data/mysql/master.info?
  45. ????????????????????SQL_Delay:?0?
  46. ??????????SQL_Remaining_Delay:?NULL?
  47. ??????Slave_SQL_Running_State:?Slave?has?read?all?relay?log;?waiting?for?the?slave?I/O?thread?to?update?it?
  48. ???????????Master_Retry_Count:?86400?
  49. ??????????????????Master_Bind:??
  50. ??????Last_IO_Error_Timestamp:??
  51. ?????Last_SQL_Error_Timestamp:??
  52. ???????????????Master_SSL_Crl:??
  53. ???????????Master_SSL_Crlpath:??
  54. ???????????Retrieved_Gtid_Set:??
  55. ????????????Executed_Gtid_Set:??
  56. ????????????????Auto_Position:?0?
  57. 1?row?in?set?(0.00?sec)?
  58. ?
  59. ERROR:??
  60. No?query?specified?

?MYSQL应用

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读