Kami mengalami masalah yang sama dengan BLOB yang salah dibaca kembali sebagai string UTF-8 dengan MySQL 8.0.13, mysql-connector-python 8.0.13, dan sqlalchemy 1.2.14.
Apa triknya bagi kami adalah mengaktifkan use_pure
opsi Konektor MySQL
. Default use_pure
telah berubah di 8.0.11 dengan default baru adalah menggunakan Ekstensi C. Jadi, kami mengatur kembali opsi:
create_engine(uri, connect_args={'use_pure': True}, ...)
Detail kesalahan dan jejak tumpukan kami:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9c in position 1: invalid start byte
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
....
File "/usr/local/lib/python3.6/site-packages/mysql/connector/cursor_cext.py", line 272, in execute
self._handle_result(result)
File "/usr/local/lib/python3.6/site-packages/mysql/connector/cursor_cext.py", line 163, in _handle_result
self._handle_resultset()
File "/usr/local/lib/python3.6/site-packages/mysql/connector/cursor_cext.py", line 651, in _handle_resultset
self._rows = self._cnx.get_rows()[0]
File "/usr/local/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 273, in get_rows
row = self._cmysql.fetch_row()
SystemError: <built-in method fetch_row of _mysql_connector.MySQL object at 0x5627dcfdf9f0> returned a result with an error set