进行与mysql数据库连接的时候出现错误
# 获取数据库链接 conn = pymysql.connect(host='localhost', user='root', password='123456', db='baike', charset='utf8md4', port=3306)
错误:
Traceback (most recent call last): File "E:/GC/imooc/MySQL.py", line 31, in <module> port=3306) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymysql\__init__.py", line 90, in Connect return Connection(*args, **kwargs) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymysql\connections.py", line 659, in __init__ self.encoding = charset_by_name(self.charset).encoding AttributeError: 'NoneType' object has no attribute 'encoding'
尝试多种方法仍然不能够解决