当前位置: 首页 > web >正文

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 event                   Master_Host: 10.249.2.81                   Master_User: wolf                   Master_Port: 3306                 Connect_Retry: 60               Master_Log_File: 81-log-bin.000113           Read_Master_Log_Pos: 12001316                Relay_Log_File: 82-relay-log.000202                 Relay_Log_Pos: 6159429         Relay_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: 1061                    Last_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: 0           Exec_Master_Log_Pos: 6159265               Relay_Log_Space: 377880603               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: 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: 281                   Master_UUID: 3a38cbd3-359c-11e5-ab1b-90e2ba7e4104              Master_Info_File: /data/mysql_3306/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: 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)

http://www.xdnf.cn/news/11525.html

相关文章:

  • [转载] SQL习题及答案
  • 分析Win7系统各种版本的区别 你的电脑适合哪个版本?
  • 192. Web前端网页制作 《你的名字》动漫主题网页设计实例 大学生期末大作业 html+css+js
  • C语言程序设计(第四版)—习题10程序设计题
  • Android OpenGL使用GLSurfaceView预览视频
  • 心脏出血(Heartbleed)漏洞浅析、复现
  • 【详解智能座舱通信技术--转载】
  • Android 2.3定制ROM CyanogenMod 7装机量超22万
  • 提示“QQ在线状态服务尚未启用,您需要添加对方为好友才能与其进行会话”解决方法
  • 奇妙动漫世界
  • 工业大数据浅析(上篇)——工业大数据的概念、发展及价值
  • 声屏障:声屏障
  • 软件开发的必备步骤
  • 超全的数据可视化图表组件,建议收藏!
  • 如何正确对待止损止盈?6大止损法、10种止盈技巧,让你的利润奔跑!
  • 在线代理(Web ProxyServer)完全详解
  • 全站静态化
  • 清除系统LJ(绿色单文件版)
  • 《大数据之路:阿里巴巴大数据实践》:看阿里人从IT时代走向DT时代的经验之谈!_大数据之路 阿里巴巴大数据实践 感悟(1)
  • 医院门诊排队叫号系统
  • offsetParent 深度解析
  • 继电器的工作原理及驱动电路
  • NSIS 下载
  • bluetooth外围设备找不到驱动程序怎么解决
  • 从数据库中取时间值,遇到:java.sql.Timestamp cannot be cast to java.lang.Long
  • android 9.0广播动态注册和接收流程
  • 5个好用的网络故障排除工具分享_ip tools network utilities
  • Windows11出现找不到d3dx9_25.dll文件如何处理??
  • 循环冗余校验(CRC)
  • MKV格式详解