pymysql连接数据库插入中文字符串错误

pymysql.err.InternalError: (1366, "Incorrect string value: .....)

数据库管理工具为heidisql

(1)更改数据库的排序规则

pymysql连接数据库插入中文字符串错误

(2)更改数据库表的默认字符集,更改具体字段的排序

pymysql连接数据库插入中文字符串错误

(3)更改charset="utf8mb4"
db = pymysql.connect(host='127.0.0.1', user='root', passwd='***', db='***', charset="utf8mb4", use_unicode=True)