I have a table in pandas dataframe df.
product_id_x product_id_y count date
0 288472 288473 1 2016-11-08 04:02:07
1 288473 2933696 1 2016-11-08 04:02:07
2 288473 85694162 1 2016-11-08 04:02:07
i want to save this table in mysql database.
i am using MySQLdb package.
import MySQLdb
conn = MySQLdb.connect(host="xxx.xxx.xx.xx", user="name", passwd="pwd", db="dbname")
df.to_sql(con = conn, name = 'sample_insert', if_exists = 'append', flavor = 'mysql', index = False)
i used this query to put it in my db.
but i am getting error.
ValueError: database flavor mysql is not supported
my datatype is str for all the columns.
type(df['product_id_x'][0]) = str
type(df['product_id_y'][0]) = str
type(df['count'][0]) = str
type(df['date'][0]) = str
i don't want to use sqlalchemy or other packages, can anyone tell what's the error here. Thanks in advance