↑↑↑ 点击“Linux运维技术之路”关注,希望对您有所帮助!
一、问题描述
[root@mysql-slave ~]# mysql -uroot -pXXX
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 44883881
Server version: 5.7.23-log MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
45: root@localhost:[(none)]> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 172.16.161.102
Master_User: slave115
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000460
Read_Master_Log_Pos: 332071142
Relay_Log_File: mysql-slave-relay-bin.000467
Relay_Log_Pos: 62605418
Relay_Master_Log_File: mysql-bin.000460
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB: LinuxYunwei
Replicate_Ignore_DB: mysql,information_schema,performance_schema,sys
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table: LinuxYunwei.%
Replicate_Wild_Ignore_Table:
Last_Errno: 1677
Last_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction 'ANONYMOUS' at master log mysql-bin.000460, end_log_pos 331041034. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.
Skip_Counter: 0
Exec_Master_Log_Pos: 331040734
Relay_Log_Space: 332071706
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: 1677
Last_SQL_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction 'ANONYMOUS' at master log mysql-bin.000460, end_log_pos 331041034. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: b575c55f-3071-11e7-86a6-000c2987deeb
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: 210608 17:43:16
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
1 row in set (0.00 sec)
ERROR:
No query specified复制
具体细节
45: root@localhost:[(none)]> select * from performance_schema.replication_applier_status_by_worker;
+--------------+-----------+-----------+---------------+-----------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+
| CHANNEL_NAME | WORKER_ID | THREAD_ID | SERVICE_STATE | LAST_SEEN_TRANSACTION | LAST_ERROR_NUMBER | LAST_ERROR_MESSAGE | LAST_ERROR_TIMESTAMP |
+--------------+-----------+-----------+---------------+-----------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+
| | 1 | NULL | OFF | ANONYMOUS | 1677 | Worker 1 failed executing transaction 'ANONYMOUS' at master log mysql-bin.000460, end_log_pos 331041034; Column 1 of table 'LinuxYunwei.DWH_TRADER_FEATURE_DF' cannot be converted from type 'varchar(255(bytes))' to type 'varchar(765(bytes) utf8)' | 2021-06-08 17:43:16 |
| | 2 | NULL | OFF | ANONYMOUS | 0 | | 0000-00-00 00:00:00 |
| | 3 | NULL | OFF | ANONYMOUS | 0 | | 0000-00-00 00:00:00 |
| | 4 | NULL | OFF | ANONYMOUS | 0 | | 0000-00-00 00:00:00 |
| | 5 | NULL | OFF | ANONYMOUS | 0 | | 0000-00-00 00:00:00 |
| | 6 | NULL | OFF | ANONYMOUS | 0 | | 0000-00-00 00:00:00 |
| | 7 | NULL | OFF | ANONYMOUS | 0 | | 0000-00-00 00:00:00 |
| | 8 | NULL | OFF | ANONYMOUS | 0 | | 0000-00-00 00:00:00 |
+--------------+-----------+-----------+---------------+-----------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+复制
二、解决方法
快速处理
stop slave;
set global slave_type_conversions=ALL_NON_LOSSY;
start slave;复制
展示信息
46: root@localhost:[(none)]> stop slave;
Query OK, 0 rows affected (0.00 sec)
53: root@localhost:[(none)]> set global slave_type_conversions=ALL_NON_LOSSY;
Query OK, 0 rows affected (0.00 sec)
53: root@localhost:[(none)]> start slave;
Query OK, 0 rows affected (0.02 sec)
53: root@localhost:[(none)]> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 172.16.161.102
Master_User: slave115
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000460
Read_Master_Log_Pos: 334851277
Relay_Log_File: mysql-slave-relay-bin.000467
Relay_Log_Pos: 64378307
Relay_Master_Log_File: mysql-bin.000460
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: LinuxYunwei
Replicate_Ignore_DB: mysql,information_schema,performance_schema,sys
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table: LinuxYunwei.%
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 332813623
Relay_Log_Space: 334852239
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: 274
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: 1
Master_UUID: b575c55f-3071-11e7-86a6-000c2987deeb
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Waiting for dependent transaction to commit
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
1 row in set (0.00 sec)
ERROR:
No query specified复制
总结:ALL_NON_LOSSY(无损转换) 该模式下,不会导致数据丢失和截断,因为该值只允许同类的小数据类型转换为大数据类型,其他模式的转换都会发生1677错误。生产环境建议设置该值
爱运维^_^爱分享
麻烦转发、在看、赞 👇
文章转载自Linux运维技术之路,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
【MySQL 30周年庆】MySQL 8.0 OCP考试限时免费!教你免费领考券
墨天轮小教习
2797次阅读
2025-04-25 18:53:11
MySQL 30 周年庆!MySQL 8.4 认证免费考!这次是认真的。。。
严少安
821次阅读
2025-04-25 15:30:58
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
475次阅读
2025-04-17 17:02:24
MySQL 9.3 正式 GA,我却大失所望,新特性亮点与隐忧并存?
JiekeXu
419次阅读
2025-04-15 23:49:58
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
369次阅读
2025-04-15 14:48:05
记录MySQL数据库的一些奇怪的迁移需求!
陈举超
269次阅读
2025-04-15 15:27:53
MySQL 8.0 OCP 1Z0-908 考试解析指南(二)
JiekeXu
262次阅读
2025-04-30 17:37:37
SQL优化 - explain查看SQL执行计划(下)
金同学
246次阅读
2025-05-06 14:40:00
MySQL 8.4 新特性深度解析:功能增强、废弃项与移除项全指南
JiekeXu
221次阅读
2025-04-18 20:21:32
MySQL 8.0 OCP 1Z0-908 考试题解析指南
青年数据库学习互助会
216次阅读
2025-04-30 12:17:54