MYSQL 版本 8.0.23
表中包含一binary的列,报如下错误:
Traceback (most recent call last):
File "binlog2sql.py", line 150, in
binlog2sql.process_binlog()
File "binlog2sql.py", line 106, in process_binlog
sql = concat_sql_from_binlog_event(cursor=cursor, binlog_event=binlog_event, no_pk=self.no_pk,
File "/opt/binlog2sql/binlog2sql/binlog2sql_util.py", line 177, in concat_sql_from_binlog_event
pattern = generate_sql_pattern(binlog_event, row=row, flashback=flashback, no_pk=no_pk)
File "/opt/binlog2sql/binlog2sql/binlog2sql_util.py", line 241, in generate_sql_pattern
return {'template': template, 'values': list(values)}
File "/opt/binlog2sql/binlog2sql/binlog2sql_util.py", line 142, in fix_object
return value.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xeb in position 1: invalid continuation byte
可以将 blob 转成十六进制值,我改了一版,已经支持了,你可以试试:
https://github.com/michael-liumh/binlog2sql.git
可以将 blob 转成十六进制值,我改了一版,已经支持了,你可以试试: https://github.com/michael-liumh/binlog2sql.git
收到回复后,第一时间测试了下,可以恢复了,感谢