1.安装mysql-connector-python驱动 pip install mysql-connector-python 2.修改代码 engine = create_engine("mysql+pymysql://root:password@localhost/my_db") 改为: engine = create_engine("mysql+mysqlconnector://root:password@localhost/my_db")
详细文档可参考:https://www.jianshu.com/p/e09eb9cc2830