df_row.head()
identifier link likes_count company
0 2292512316069378197 https://www.instagram.com/p/B_Qo84ihfiV 9608 Ralph Lauren
1 2292462538514040606 https://www.instagram.com/p/B_QdohlBQce 9462 Ralph Lauren
2 2292418655784545069 https://www.instagram.com/p/B_QTp8mhCst 22033 Ralph Lauren
3 2292372137723669561 https://www.instagram.com/p/B_QJFBSBaw5 14112 Ralph Lauren
4 2292334760619881771 https://www.instagram.com/p/B_QAlHJBzUr 5974 Ralph Lauren
# import the module
from sqlalchemy import create_engine
# create sqlalchemy engine
engine = create_engine("mysql+pymysql://{user}:{pw}@localhost{db}"
.format(user="admin",
pw="abcdef",
db="ghi"))
df_row.to_sql('df_row', con = engine, if_exists = 'append', chunksize = 1000)
When I run the code above, the following message comes out: InternalError: (pymysql.err.InternalError) (1054, "Unknown column 'index' in 'field list'")