【发布时间】:2018-09-15 09:14:54
【问题描述】:
我正在尝试更新一分钟前运行良好的表格,但现在我遇到了过去遇到的一个非常不方便的错误。
09:32:57 Copying rows caused a MySQL error 1300:
Level: Warning
Code: 1300
Message: Invalid utf8mb4 character string: '94C494'
有没有什么选项可以让我忽略这些警告?毕竟这只是一个警告,所以 MySQL 仍然有能力继续前进并复制行。
其他解决方案也可以,例如在表格中找到违规值或删除无效部分的方法,或者只是让我可以更改表格的方法会很棒。
我在谷歌上搜索如何在 MySQL 中查找/替换损坏的 utf8 序列给我带来了这些链接(没有太大帮助)
- https://dba.stackexchange.com/questions/77101/how-to-find-non-utf8-data-in-mysql/77154
- Detecting utf8 broken characters in MySQL
我什至尝试搜索十六进制包含无效序列的所有列,但仍然不知何故没有运气
select * from `notifications`
where hex(`Description`) like '%94C494%'
or hex(`Title`) like '%94C494%'
or hex(`NotificationID`) like '%94C494%'
or hex(`ToUserID`) like '%94C494%'
or hex(`FromUserID`) like '%94C494%'
or hex(`Link`) like '%94C494%'
or hex(`Icon`) like '%94C494%';
MySQL 版本为 5.7.18-15-57-log 和 pt-online-schema-change 3.0.8
即使是陌生人,我还是决定自娱自乐并搜索所有列(不仅仅是 utf8mb4 列),然后我得到了行!但我得到的唯一行来自我的二进制列?为什么在二进制列中有无效的 utf8 序列很重要?现在我认为这可能是该工具的错误
select * ,hex(`notificationid`), hex(`notificationbid`), hex(`fromuserid`), hex(`touserid`), hex(`title`), hex(`description`), hex(`read`), hex(`datetimeadded`), hex(`link`), hex(`icon`), hex(`shown`), hex(`_linkdescriptionsha256`), hex(`_touseridlinkdescription+sha3-224`)
from `notifications`
where hex(`notificationid`) like '%94C494%'
or hex(`notificationbid`) like '%94C494%'
or hex(`fromuserid`) like '%94C494%'
or hex(`touserid`) like '%94C494%'
or hex(`title`) like '%94C494%'
or hex(`description`) like '%94C494%'
or hex(`read`) like '%94C494%'
or hex(`datetimeadded`) like '%94C494%'
or hex(`link`) like '%94C494%'
or hex(`icon`) like '%94C494%'
or hex(`shown`) like '%94C494%'
or hex(`_linkdescriptionsha256`) like '%94C494%'
or hex(`_touseridlinkdescription+sha3-224`) like '%94C494%';
【问题讨论】:
标签: mysql pt-online-schema-change