I need help to get this working. I have a pd.DataFrame (df), which I need to load to a MySQL database. I don\'t understand what the error message means and how
pd.DataFrame (df)
For me this was fixed using
MySQLdb.connect("127.0.0.1","root","","db" )
instead of
MySQLdb.connect("localhost","root","","db" )
and then
df.to_sql('df',sql_cnxn,flavor='mysql',if_exists='replace', chunksize=100)