Is it possible to create engine using mySql connector instead of sqlalchemy? Most of the time people use sqlalchemy to create an engine and then use it to write to db using to_sql.
engine = create_engine("mysql+pymysql://{user}:{pw}@localhost/{db}"
.format(user="user",
pw="Password",
db="dbname"))
df.to_sql(con=engine, name='Summary', if_exists='replace', index=False)