解决sqlalchemy连接数据库出现的报错

问题一:AttributeEror:"Nonetype" object has no attribute‘encoding"

解决方法将utf-8 改为 utf8

问题二

Warning: (3719, "‘utf8‘ is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.")
result = self._query(query)

解决办法 将utf8mb4

问题三:(1193,Unknown system variable ‘tx_isolation‘).  

出现此报错的原因是使用的mysql8.0 以前用的是:tx_isolation 现在用是: transaction_isolation  

解决办法一:通过升级sqlalchemy的方法解决。pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade sqlalchemy --ignore-installed

解决办法二:降低mysql的版本

相关推荐