Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

表中包含binary字段的问题 #87

Open
qq122356 opened this issue Jun 28, 2021 · 3 comments
Open

表中包含binary字段的问题 #87

qq122356 opened this issue Jun 28, 2021 · 3 comments

Comments

@qq122356
Copy link

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

@michael-liumh
Copy link

binary 列转成十六进制就行

@michael-liumh
Copy link

可以将 blob 转成十六进制值,我改了一版,已经支持了,你可以试试:
https://github.com/michael-liumh/binlog2sql.git

@qq122356
Copy link
Author

可以将 blob 转成十六进制值,我改了一版,已经支持了,你可以试试: https://github.com/michael-liumh/binlog2sql.git

收到回复后,第一时间测试了下,可以恢复了,感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants