失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > mysql 1061报错_mysql主从 1061 log同步错误处理

mysql 1061报错_mysql主从 1061 log同步错误处理

时间:2022-01-25 02:42:53

相关推荐

mysql 1061报错_mysql主从 1061 log同步错误处理

1062和1063错误可以跳过 开发在从库上添加索引导致不同步。 报错如下 Last_Errno: 1061 error 'Duplicate key name 'wolf_cert_no'' on query. Default database: 'wolf'. Query: 'ALTER TABLE cpn_wolf ADD INDEX wolf_cert_no (cert_no)' 库 wolf 表 cpn_wolf 索引 wolf_cert_no (cert_no) mysql> show index from cpn_wolf; +------------+------------+--------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name| Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +------------+------------+--------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | cpn_wolf |0 | PRIMARY|1 | id| A| 1432485 | NULL | NULL | | BTREE || | | cpn_wolf |1 | wolf_cert_no |1 | cert_no | A| 1432485 | NULL | NULL | YES | BTREE || | +------------+------------+--------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 2 rows in set (0.00 sec) 从库上删除 ALTER TABLE `cpn_wolf` DROP INDEX `cert_no`; 从起从库 use mysql stop slave; start slave; mysql> show slave status\G; *************************** 1. row *************************** Slave_IO_State: Waiting for master to send eventMaster_Host: 10.249.2.81Master_User: wolfMaster_Port: 3306 Connect_Retry: 60 Master_Log_File: 81-log-bin.000113Read_Master_Log_Pos: 12001316 Relay_Log_File: 82-relay-log.000202 Relay_Log_Pos: 6159429Relay_Master_Log_File: 81-log-bin.000103 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Do_DB:Replicate_Ignore_DB:Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table:Last_Errno: 1061Last_Error: Error 'Duplicate key name 'wolf_cert_no'' on query. Default database: 'wolf'. Query: 'ALTER TABLE cpn_wolf ADD INDEX wolf_cert_no (cert_no)' Skip_Counter: 0Exec_Master_Log_Pos: 6159265 Relay_Log_Space: 377880603 Until_Condition: None Until_Log_File: Until_Log_Pos: 0Master_SSL_Allowed: NoMaster_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: 1061 Last_SQL_Error: Error 'Duplicate key name 'wolf_cert_no'' on query. Default database: 'wolf'. Query: 'ALTER TABLE cpn_wolf ADD INDEX wolf_cert_no (cert_no)' Replicate_Ignore_Server_Ids: Master_Server_Id: 281Master_UUID: 3a38cbd3-359c-11e5-ab1b-90e2ba7e4104 Master_Info_File: /data/mysql_3306/master.info SQL_Delay: 0SQL_Remaining_Delay: NULL Slave_SQL_Running_State:Master_Retry_Count: 86400Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: 160506 13:27:58 Master_SSL_Crl:Master_SSL_Crlpath:Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 0 1 row in set (0.00 sec)

如果觉得《mysql 1061报错_mysql主从 1061 log同步错误处理》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。