How to create a new table in a MySQL DB from a pandas dataframe

后端 未结 2 1318
面向向阳花
面向向阳花 2021-01-06 19:57

I recently transitioned from using SQLite for most of my data storage and management needs to MySQL. I think I\'ve finally gotten the correct libraries installed to work wit

2条回答
  •  北海茫月
    2021-01-06 20:18

    This

    connection = engine.connect()
    df.to_sql(con=connection, name='TBL_NAME', schema='SCHEMA', index=False, if_exists='replace')
    

    works with oracle DB in specific schema wothout errors, but will not work if you have limited permissions. And note that table names is case sensative.

提交回复
热议问题