I want to store JSON Data into MySQL Database using Python. I used dataframe of pandas. I found that to_sql() can do this job easily.

Python Code:

df.to_sql(con=con, name='crashTable', if_exists='replace', flavor='mysql')


TypeError: to_sql() got an unexpected keyword argument 'flavor'

I got this error message. How to resolve this error?


1 Answer 1


Based on the documentation 0.22 and 0.24.1, the flavor does not exist in the argument list of the to_sql method. You're probably running the 0.24.1 version which does not need flavor argument.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.