File "D:\Programfiles\Anaconda3\lib\site-packages\pymysql\connections.py", line 1269, in _get_server_information

self.server_charset = charset_by_id(lang).name

File "D:\Programfiles\Anaconda3\lib\site-packages\pymysql\charset.py", line 38, in by_id

return self._by_id[id]

KeyError: 255

因为是MySQL8.0革新了很多字符集,然而那些字符集长度胜过255了,以是旧版的PyMySQL不扶助长度胜过255的字符

pip install –upgrade pymysql

即使还不许用

卸载重装Mysql