I am trying to insert values into a mysql table using python,I have some values but i donot consider whether duplicate keys/non duplicate but i want every values to be inserted.
For my mysql coding what changes should i make to insert duplicates?
for name,hobby in p:
print name,hobby
cursor.execute(
'''INSERT INTO Details (Names, Hobby)
VALUES (%s, %s)''',
(name,hobby))
I get the following error!
IntegrityError: (1062, "Duplicate entry 'Leelal' for key 'PRIMARY'")
Please help me in getting the duplicate values into the table!
Table schema:
Id | Names | Hobby
Is there a way to auto increment Id as long as the Names and Hobby present in list?