I've looked in many places and a lot of answers this but i really didn't found.
The problem is: I have a CSV file that i'm filling a pandas dataframe, and then i want to insert those dataframe into a MySQL database.
engine = create_engine("mysql+mysqldb://USER:"+'PSWRD'+"@HOST:3306/schema", echo=False)
with engine.connect() as conn, conn.begin():
df.to_sql(name='tbl_TestPython',con=conn, if_exists='append', index=False)
When i run this i get no error, but in my database nothing changes ( nothing inserted).I tried to change "if_exists" to 'replace' but didn't work, also tried to remove "With engine...." and let just the line "df.to_sql..." but nothing too, any mistakes or inserted data
Could anyone help please?
information_schema.tableswhether your table has been created in another DB... - MaxU'tbl_TestPython2'and check whether it'll be created in MySQL DB - MaxU