MySQL Last_SQL_Errno: 1062
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了MySQL Last_SQL_Errno: 1062,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含5388字,纯文字阅读大概需要8分钟。
内容图文
![MySQL Last_SQL_Errno: 1062](/upload/InfoBanner/zyjiaocheng/479/c89c0b37fb7740eab6965c007e0bdea0.jpg)
三、处理过程
1.查看报错信息
(root@localhost) [(none)]> show slave status\G;
*************************** 1. row ***************************
...............略.............................
Last_Errno: 1062
Last_Error: Could not execute Write_rows event on table user-center.t_dea_info; Duplicate entry ‘89465d5d792541459e38cabaf677c95e‘ for key ‘PRIMARY‘, Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event‘s master log mysql-bin.000005, end_log_pos 469856269
Skip_Counter: 0
Exec_Master_Log_Pos: 469855892
Relay_Log_Space: 470236370
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
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: 0
Last_IO_Error:
Last_SQL_Errno: 1062
Last_SQL_Error: Could not execute Write_rows event on table user-center.t_dea_info; Duplicate entry ‘89465d5d792541459e38cabaf677c95e‘ for key ‘PRIMARY‘, Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event‘s master log mysql-bin.000005, end_log_pos 469856269
Replicate_Ignore_Server_Ids:
Master_Server_Id: 157
Master_UUID: 77220b08-41ab-11e5-b9be-000ec4cac97a
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State:
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp: 170410 16:10:01
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 77220b08-41ab-11e5-b9be-000ec4cac97a:33417992-37560729
Executed_Gtid_Set: 1d7e2d03-084b-11e6-88f0-000ec4cac979:1-3236,
716feeae-41b4-11e5-82c2-000ec4cac979:1-2,
77220b08-41ab-11e5-b9be-000ec4cac97a:1-37559950,
99bcf840-22f5-11e6-b6d2-000ec4cac981:1-10
Auto_Position: 1
1 row in set (0.00 sec)
2.确认需要跳过的gtid是关键
找到这个已经执行的gtid,加1
77220b08-41ab-11e5-b9be-000ec4cac97a:1-37559950,
3.跳gtid
(root@localhost) [(none)]> stop slave;
(root@localhost) [(none)]> SET @@SESSION.GTID_NEXT= ‘77220b08-41ab-11e5-b9be-000ec4cac97a:37559951‘;
Query OK, 0 rows affected (0.00 sec)
(root@localhost) [(none)]> BEGIN; COMMIT;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
(root@localhost) [(none)]> SET SESSION GTID_NEXT = AUTOMATIC;
Query OK, 0 rows affected (0.00 sec)
4.重启线程,查看状态,确认OK
(root@localhost) [(none)]> START SLAVE;
Query OK, 0 rows affected, 1 warning (0.00 sec)
(root@localhost) [(none)]> show slave status\G;
*************************** 1. row ***************************
.........................略............................
Master_Log_File: mysql-bin.000005
Read_Master_Log_Pos: 470459548
Relay_Log_File: relay-bin.000016
Relay_Log_Pos: 70709
Relay_Master_Log_File: mysql-bin.000005
Slave_IO_Running: Yes
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: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 470459548
Relay_Log_Space: 114127
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 157
Master_UUID: 77220b08-41ab-11e5-b9be-000ec4cac97a
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
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: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 77220b08-41ab-11e5-b9be-000ec4cac97a:33417992-37561196
Executed_Gtid_Set: 1d7e2d03-084b-11e6-88f0-000ec4cac979:1-3236,
716feeae-41b4-11e5-82c2-000ec4cac979:1-2,
77220b08-41ab-11e5-b9be-000ec4cac97a:1-37561196,
99bcf840-22f5-11e6-b6d2-000ec4cac981:1-10
Auto_Position: 1
1 row in set (0.00 sec)
ERROR:
No query specified
四、关键点
1.找到需要跳过的GTID,知道为什么要加1,理解了原理,问题就迎刃而解了。
本文出自 “roidba” 博客,请务必保留此出处http://roidba.blog.51cto.com/12318731/1914604
MySQL Last_SQL_Errno: 1062
标签:last_sql_errno: 1062
本文系统来源:http://roidba.blog.51cto.com/12318731/1914604
内容总结
以上是互联网集市为您收集整理的MySQL Last_SQL_Errno: 1062全部内容,希望文章能够帮你解决MySQL Last_SQL_Errno: 1062所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。