I have a dataframe with string dates I convert them to datetime time using pd.to_datetime()
then when I create insedrt query and make cursor.execute() it returns this error to me
"mysql.connector.errors.ProgrammingError: Failed processing format-parameters; Python 'timestamp' cannot be converted to a MySQL type "
df['Date'] = pd.to_datetime(df['Date'])
for i,row in df.iterrows():
sql="INSERT INTO db.datestable (Date,Name) VALUES (%s,%s);"
my_cursor.execute(sql, tuple(row))