-
Notifications
You must be signed in to change notification settings - Fork 681
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
LookupError: unknown encoding: utf8mb3 #386
Comments
I added these lines in pymsql/charset.py and LookupError was fixed. but I am not sure if this is a good practice... |
Hello, I have the exact same issue. I am also looking for a more long-term fix rather than juste tweaking the pymysql library. |
@blackoctop did you try to submit a PR to pymysql to include your fix? |
@the4thdoctor I opened issue and got this answer: methane commented 24 days ago @methane methane closed this as [not planned] |
🤦 |
We also got this issue when I updated MySQL RDS from version 5.7 to 8.0.
Ref. https://dev.mysql.com/doc/refman/8.0/en/mysql-nutshell.html#mysql-nutshell-deprecations |
this worked for me! was wondering if anybody found a better solution though? |
thanks! |
I have super simple example of BinLogStreamReader:
mysql_settings =
{'host': host,
'port': port,
'user': user,
'passwd': passw
}
stream = BinLogStreamReader(
connection_settings=mysql_settings,
server_id=1024,
is_mariadb=True,
# blocking=True,
only_events=[DeleteRowsEvent, UpdateRowsEvent, WriteRowsEvent],
# resume_stream=True,
only_tables=[table],
only_schemas=[schema]
)
which goes on exception on line "for row in binlogevent.rows:"
for binlogevent in stream:
for row in binlogevent.rows:
print(row)
stream.close()
Traceback (most recent call last):
File "C:\Users\user\Desktop\pyProjects\replica\binlogreader\test.py", line 93, in
print(binlogevent.rows)
File "C:\Users\user\Desktop\pyProjects\replica.env\lib\site-packages\pymysqlreplication\row_event.py", line 459, in rows
self._fetch_rows()
File "C:\Users\user\Desktop\pyProjects\replica.env\lib\site-packages\pymysqlreplication\row_event.py", line 454, in _fetch_rows
self.__rows.append(self._fetch_one_row())
File "C:\Users\user\Desktop\pyProjects\replica.env\lib\site-packages\pymysqlreplication\row_event.py", line 545, in _fetch_one_row
row["after_values"] = self._read_column_data(self.columns_present_bitmap2)
File "C:\Users\user\Desktop\pyProjects\replica.env\lib\site-packages\pymysqlreplication\row_event.py", line 154, in _read_column_data
values[name] = self.__read_string(2, column)
File "C:\Users\user\Desktop\pyProjects\replica.env\lib\site-packages\pymysqlreplication\row_event.py", line 250, in __read_string
string = string.decode(encoding)
LookupError: unknown encoding: utf8mb3
The text was updated successfully, but these errors were encountered: