Python:‘NoneType‘ object has no attribute ‘encoding‘问题的解决

AttributeError: ‘NoneType’ object has no attribute ‘encoding’
python连接mysql数据库问题
如图创建connect
请添加图片描述
报错如下所示
在这里插入图片描述
解决方法:
charset=‘utf-8’改成charset=‘utf8’
所引用的connection.py包版本不一样会有区别!
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_45937957/article/details/121776252
今日推荐