Answer the question
In order to leave comments, you need to log in
Find source of duplicate data in mysql?
In general, there are 2 servers, the second takes data from one, parses, and saves it to the database. We noticed that duplicate records began to appear. There can be any number of duplicates. I started to sin on the client displaying the records, I looked through the phpMyAdmin database, everything is OK (or rather not OK :)), there are really duplicates in the database. Made saving of the data which came from the first server + sql which goes to basis. Now I’m looking at the log, there are no duplicates in the incoming data, there are no duplicates in the database, there are duplicates in the database ...
I’m at a dead end, tell me at least where you can dig, what else to check.
Answer the question
In order to leave comments, you need to log in
Make a composite primary key so it's unique and insert records using INSERT IGNORE.
The solution has already been suggested above.
On my own behalf, I’ll add that in your case a composite key is not needed, one unique index is enough for the 'id' field, unless of course its name corresponds to the content).
Something like this:
ALTER TABLE progstat ADD UNIQUE INDEX (id)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question