使用引擎代替
raw_connection()工作引擎:
import pandas as pdimport mysql.connectorfrom sqlalchemy import create_engineengine = create_engine('mysql+mysqlconnector://[user]:[pass]@[host]:[port]/[schema]', echo=False)data.to_sql(name='sample_table2', con=engine, if_exists = 'append', index=False)不清楚为什么我昨天尝试这样做时会给我更早的错误。



