使用sqlalchemy和mysqlpython,如何设置charset=utf8mb4?

2024-07-05 10:12:12 发布

您现在位置:Python中文网/ 问答频道 /正文

engine = create_engine('mysql+mysqldb://root:123456@localhost:3306/tianchi?charset=utf8mb4')

回溯:

在sqlalchemy.exc.operational错误:(\u mysql_异常操作错误)(2019,“无法初始化字符集utf8mb4(路径:C:\mysql\\share\charsets\)”)

enter image description here

sqL方法:1.2.7 Mysql数据库-python:1.2.5 Mysql:5.7.13在


Tags: localhostsqlalchemy错误createmysqlrootengineexc