I'm trying to insert this tuple into a mysql table.
extract of the tuple:
('2022-06-29 04:50:00', 'var1', 'var2', 'value'), ('2022-06-29 10:58:00', 'var1', 'var2', 'value'), ('2022-06-29 10:59:00', 'var1', 'var2', 'value'), ('2022-06-29 11:01:00', 'var1', 'var2', 'value'),...
This is my code:
    import MySQLdb
    
    connexion = MySQLdb.connect(host="127.0.0.1", user="myuser", password="mypass", database="mydb")
    cursor = connexion.cursor()
    table = mytablename
    
    cursor.execute("""insert ignore into " + table  + "(collection_date, var1, var2, value) values ('%s', '%s', '%s', '%s')""".format(",".join(str(i) for i in tuples)))
    connexion.commit()
But i got this error:
MySQLdb._exceptions.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'" + table  + "(collection_date, var1, var2, value) values (\'%s\', \'%s\', \'%s\', \'\' at line 1')
Many thanks for any help,
BR,
 
    